Skip to content

Commit

Permalink
Move check up
Browse files Browse the repository at this point in the history
  • Loading branch information
mshinwell committed Oct 23, 2023
1 parent 667c49f commit 6087e5c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions asmcomp/asmlink.ml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ let implementations_defined = ref ([] : (CU.t * string) list)
let cmx_required = ref ([] : CU.t list)

let check_consistency file_name unit crc =
let ui_name = CU.name unit.ui_unit in
begin try
let source = List.assoc unit.ui_unit !implementations_defined in
raise (Error(Multiple_definition(ui_name, file_name, source)))
with Not_found -> ()
end;
begin try
Array.iter
(fun import ->
Expand Down Expand Up @@ -86,12 +92,6 @@ let check_consistency file_name unit crc =
} ->
raise(Error(Inconsistent_implementation(name, user, auth)))
end;
let ui_name = CU.name unit.ui_unit in
begin try
let source = List.assoc unit.ui_unit !implementations_defined in
raise (Error(Multiple_definition(ui_name, file_name, source)))
with Not_found -> ()
end;
implementations := unit.ui_unit :: !implementations;
Cmx_consistbl.check crc_implementations unit.ui_unit () crc file_name;
implementations_defined :=
Expand Down

0 comments on commit 6087e5c

Please sign in to comment.