operand: include '+0' in named symbol references
Intended to address an asmdecl error. [amd64] Butterfly: use of unnamed argument 0(FP); offset 0 is x0+0(FP) Updates #24
This commit is contained in:
@@ -87,12 +87,10 @@ func (m Mem) Idx(r reg.Register, s uint8) Mem {
|
||||
// Asm returns an assembly syntax representation of m.
|
||||
func (m Mem) Asm() string {
|
||||
a := m.Symbol.String()
|
||||
if m.Disp != 0 {
|
||||
if a == "" {
|
||||
a += fmt.Sprintf("%d", m.Disp)
|
||||
} else {
|
||||
a += fmt.Sprintf("%+d", m.Disp)
|
||||
}
|
||||
if a != "" {
|
||||
a += fmt.Sprintf("%+d", m.Disp)
|
||||
} else if m.Disp != 0 {
|
||||
a += fmt.Sprintf("%d", m.Disp)
|
||||
}
|
||||
if m.Base != nil {
|
||||
a += fmt.Sprintf("(%s)", m.Base.Asm())
|
||||
|
||||
Reference in New Issue
Block a user