Fixes #22093
Fixes #19988
Change-Id: Ibd8ec89e091fd527f363999e484676931d7aa6e2
Reviewed-on: https://go-review.googlesource.com/67450
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
}
func disasm_x86(code []byte, pc uint64, lookup lookupFunc, arch int) (string, int) {
- inst, err := x86asm.Decode(code, 64)
+ inst, err := x86asm.Decode(code, arch)
var text string
size := inst.Len
if err != nil || size == 0 || inst.Op == 0 {
ok = false
}
}
+ if goarch == "386" {
+ if strings.Contains(text, "(IP)") {
+ t.Errorf("disassembly contains PC-Relative addressing on 386")
+ ok = false
+ }
+ }
+
if !ok {
t.Logf("full disassembly:\n%s", text)
}
ok = false
}
}
+ if runtime.GOARCH == "386" {
+ if strings.Contains(text, "(IP)") {
+ t.Errorf("disassembly contains PC-Relative addressing on 386")
+ ok = false
+ }
+ }
if !ok {
t.Logf("full disassembly:\n%s", text)
}