From bfadad2c55c2088ee66de974bf2ad98b051c92cc Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Mon, 8 Apr 2019 16:46:32 +0200 Subject: Avoid generation of empty ranges. As noted in the DWARF 3 specification empty ranges have no effect and can be left out. Bug 26234 --- debug/DebugInformation.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'debug') diff --git a/debug/DebugInformation.ml b/debug/DebugInformation.ml index e3f5d98e..4eff6548 100644 --- a/debug/DebugInformation.ml +++ b/debug/DebugInformation.ml @@ -553,7 +553,10 @@ let close_scope atom s_id lbl = | a::rest -> a,rest | _ -> assert false (* We must have an opening scope *) end in - let new_r = ({last_r with end_addr = Some lbl;})::rest in + let new_r = if last_r.start_addr = Some lbl then + rest + else + ({last_r with end_addr = Some lbl;})::rest in Hashtbl.replace scope_ranges s_id new_r with Not_found -> () -- cgit