Skip to content

Commit a996f85

Browse files
committed
builder/createInlineAsm:avoid mapupdate collect after call
builder/createInlineAsm:with independant logic to avoid goto operate
1 parent 5625f68 commit a996f85

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
@@ -47,6 +47,7 @@ func (b *builder) createInlineAsmFull(instr *ssa.CallCommon) (llvm.Value, error)
4747
asmString := constant.StringVal(instr.Args[0].(*ssa.Const).Value)
4848
registers := map[string]llvm.Value{}
4949
if registerMap, ok := instr.Args[1].(*ssa.MakeMap); ok {
50+
referrers:
5051
for _, r := range *registerMap.Referrers() {
5152
switch r := r.(type) {
5253
case *ssa.DebugRef:
@@ -59,7 +60,9 @@ func (b *builder) createInlineAsmFull(instr *ssa.CallCommon) (llvm.Value, error)
5960
registers[key] = b.getValue(r.Value.(*ssa.MakeInterface).X, getPos(instr))
6061
case *ssa.Call:
6162
if r.Common() == instr {
62-
break
63+
// Stop processing when we encounter the AsmFull call itself
64+
// to avoid including MapUpdate operations that happen after the call
65+
break referrers
6366
}
6467
default:
6568
return llvm.Value{}, b.makeError(instr.Pos(), "don't know how to handle argument to inline assembly: "+r.String())

0 commit comments

Comments
 (0)