Skip to content

Commit 07aa451

Browse files
committed
builder/createInlineAsm:with independant logic to avoid goto operate
1 parent 633688c commit 07aa451

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/inlineasm.go

Lines changed: 2 additions & 2 deletions
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:
@@ -61,13 +62,12 @@ func (b *builder) createInlineAsmFull(instr *ssa.CallCommon) (llvm.Value, error)
6162
if r.Common() == instr {
6263
// Stop processing when we encounter the AsmFull call itself
6364
// to avoid including MapUpdate operations that happen after the call
64-
goto done
65+
break referrers
6566
}
6667
default:
6768
return llvm.Value{}, b.makeError(instr.Pos(), "don't know how to handle argument to inline assembly: "+r.String())
6869
}
6970
}
70-
done:
7171
}
7272
// TODO: handle dollar signs in asm string
7373
registerNumbers := map[string]int{}

0 commit comments

Comments
 (0)