Commits

camlspotter committed 0609fa1

a bug found around if_then_else_chain

  • Participants
  • Parent commits 6b87143
  • Branches dev

Comments (0)

Files changed (1)

File tests/if_chain.ml

+let () =
+  if magic_number = cmo_magic_number then begin
+    let cu_pos = input_binary_int ic in
+    seek_in ic cu_pos;
+    let cu = (input_value ic : compilation_unit) in
+    Some (`CMO cu)
+  end 
+  else if magic_number = cma_magic_number then begin
+    let toc_pos = input_binary_int ic in
+    seek_in ic toc_pos;
+    let toc = (input_value ic : library) in
+    Some (`CMA toc)
+  end
+  else if magic_number = cmi_magic_number then begin
+    let cmi = Cmi_format.input_cmi ic in
+    Some (`CMI cmi)
+  end else if magic_number = cmx_magic_number then begin
+    let ui = (input_value ic : unit_infos) in
+    Some (`CMX ui)
+  end