Skip to content

Commit 633688c

Browse files
committed
builder/createInlineAsm:avoid mapupdate collect after call
1 parent 5625f68 commit 633688c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/inlineasm.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,15 @@ func (b *builder) createInlineAsmFull(instr *ssa.CallCommon) (llvm.Value, error)
5959
registers[key] = b.getValue(r.Value.(*ssa.MakeInterface).X, getPos(instr))
6060
case *ssa.Call:
6161
if r.Common() == instr {
62-
break
62+
// Stop processing when we encounter the AsmFull call itself
63+
// to avoid including MapUpdate operations that happen after the call
64+
goto done
6365
}
6466
default:
6567
return llvm.Value{}, b.makeError(instr.Pos(), "don't know how to handle argument to inline assembly: "+r.String())
6668
}
6769
}
70+
done:
6871
}
6972
// TODO: handle dollar signs in asm string
7073
registerNumbers := map[string]int{}

0 commit comments

Comments
 (0)