[sledge] Protect against nonexistent paths in debug info

Summary: Do not fail when resolving the realpath of a debug info path.

Reviewed By: jvillard

Differential Revision: D24746237

fbshipit-source-id: b9dc35176
master
Josh Berdine 4 years ago committed by Facebook GitHub Bot
parent f00ee99c2c
commit d542c7b7b2

@ -13,7 +13,10 @@ type t = {dir: string; file: string; line: int; col: int}
let none = {dir= ""; file= ""; line= 0; col= 0}
let mk ?(dir = none.dir) ?(file = none.file) ?(col = none.col) ~line =
let dir = if String.is_empty dir then dir else Filename.realpath dir in
let dir =
if String.is_empty dir then dir
else try Filename.realpath dir with Unix.Unix_error _ -> dir
in
{dir; file; line; col}
let root = ref (Filename.realpath (Sys.getcwd ()))

Loading…
Cancel
Save