Skip to content

Commit 24fbb30

Browse files
Emit 1-based column indexes for source scopes in debuginfo
1 parent 1d50972 commit 24fbb30

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustc_codegen_llvm/debuginfo/create_scope_map.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,14 @@ fn make_mir_scope(cx: &CodegenCx<'ll, '_>,
8181
&loc.file.name,
8282
debug_context.defining_crate);
8383

84+
let col1 = loc.col.to_usize() + 1; // One-based column index
8485
let scope_metadata = unsafe {
8586
Some(llvm::LLVMRustDIBuilderCreateLexicalBlock(
8687
DIB(cx),
8788
parent_scope.scope_metadata.unwrap(),
8889
file_metadata,
8990
loc.line as c_uint,
90-
loc.col.to_usize() as c_uint))
91+
col1 as c_uint))
9192
};
9293
debug_context.scopes[scope] = DebugScope {
9394
scope_metadata,

0 commit comments

Comments
 (0)