Skip to content

Commit 7d1e281

Browse files
committed
Compiler: uncatched exception
1 parent 3263752 commit 7d1e281

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

compiler/parse_bytecode.ml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,16 +211,18 @@ end = struct
211211
| Event_after _ -> loc.Location.loc_end
212212
| _ -> loc.Location.loc_start in
213213
let src =
214-
let uname = Filename.(basename (chop_extension pos.Lexing.pos_fname)) in
215214
try
215+
let uname = Filename.(basename (chop_extension pos.Lexing.pos_fname)) in
216216
let unit = Hashtbl.find units uname in
217217
try Some (Util.absolute_path
218218
(Util.find_in_path unit.paths pos.Lexing.pos_fname)) with
219219
| Not_found ->
220220
match unit.source with
221221
| Some x -> Some (Util.absolute_path x)
222222
| None -> raise Not_found
223-
with Not_found -> None (* Some (pos.Lexing.pos_fname) *)
223+
with
224+
| Not_found
225+
| Invalid_argument _ -> None (* Some (pos.Lexing.pos_fname) *)
224226
in
225227
Some {Parse_info.name = Some pos.Lexing.pos_fname;
226228
src;

0 commit comments

Comments
 (0)