When writing debug HTML, don't crash on procs with empty bodies.

Reviewed By: ddino

Differential Revision: D15512985

fbshipit-source-id: 2371486b8
master
Radu Grigore 6 years ago committed by Facebook Github Bot
parent f05d98321a
commit 16431f5015

@ -171,9 +171,10 @@ module ProcsHtml : sig
end = struct
let write pdesc =
let pname = Procdesc.get_proc_name pdesc in
let source = (Procdesc.get_loc pdesc).file in
let loc = Procdesc.get_loc pdesc in
let source = loc.file in
let nodes = List.sort ~compare:Procdesc.Node.compare (Procdesc.get_nodes pdesc) in
let linenum = (Procdesc.Node.get_loc (List.hd_exn nodes)).Location.line in
let linenum = loc.Location.line in
let fd, fmt = Io_infer.Html.create source [Typ.Procname.to_filename pname] in
F.fprintf fmt "<center><h1>Procedure %a</h1></center>@\n"
(Io_infer.Html.pp_line_link source

Loading…
Cancel
Save