Skip to content

Commit 7eae649

Browse files
debuginfo: Create separate lexical block for function bodies.
1 parent 184d394 commit 7eae649

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/librustc/middle/trans/debuginfo.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2248,7 +2248,14 @@ fn populate_scope_map(cx: &mut CrateContext,
22482248
})
22492249
}
22502250

2251-
walk_block(cx, fn_entry_block, &mut scope_stack, scope_map);
2251+
// Clang creates separate scope functions bodies, so let's do this too
2252+
with_new_scope(cx,
2253+
fn_entry_block.span,
2254+
&mut scope_stack,
2255+
scope_map,
2256+
|cx, scope_stack, scope_map| {
2257+
walk_block(cx, fn_entry_block, scope_stack, scope_map);
2258+
});
22522259

22532260
// local helper functions for walking the AST.
22542261
fn with_new_scope(cx: &mut CrateContext,

0 commit comments

Comments
 (0)