From b0f04d91bf18e18459af6bb279ebe960bce75119 Mon Sep 17 00:00:00 2001 From: Li Jie Date: Wed, 18 Sep 2024 23:45:27 +0800 Subject: [PATCH] cl: fix dbg.declare (and local var) --- cl/compile.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cl/compile.go b/cl/compile.go index 09d29a95..6953bfcd 100644 --- a/cl/compile.go +++ b/cl/compile.go @@ -730,16 +730,12 @@ func (p *context) compileInstr(b llssa.Builder, instr ssa.Instruction) { // Not a local variable. return } - if v.IsAddr { - // *ssa.Alloc or *ssa.FieldAddr - return - } - pos := p.goProg.Fset.Position(v.Pos()) value := p.compileValue(b, v.X) fn := v.Parent() dbgVar := p.getLocalVariable(b, fn, variable) if v.IsAddr { + // *ssa.Alloc or *ssa.FieldAddr b.DIDeclare(value, dbgVar, p.fn, pos, b.Func.Block(v.Block().Index)) } else { b.DIValue(value, dbgVar, p.fn, pos, b.Func.Block(v.Block().Index))