浏览代码

[error reporting] don't crash for non existing files known by common context

Rudy Ges 1 年之前
父节点
当前提交
656f98aec4
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/compiler/messageReporting.ml

+ 1 - 1
src/compiler/messageReporting.ml

@@ -99,7 +99,7 @@ let compiler_pretty_message_string com ectx cm =
 				let lines = resolve_source f l1 p1 l2 p2 in
 				let epos = Lexer.get_error_pos error_printer cm.cm_pos in
 				(l1, p1, l2, p2, epos, lines)
-			end with Not_found ->
+			end with Not_found | Sys_error _ ->
 				(1, 1, 1, 1, cm.cm_pos.pfile, [])
 			in