good morning!!!!

Skip to content
Snippets Groups Projects
Commit 97b28066 authored by Guillaume Ballet's avatar Guillaume Ballet Committed by Péter Szilágyi
Browse files

core/asm: Use hexadecimal addresses in assembly dumps (#17870)

parent 11d0ff65
No related branches found
No related tags found
No related merge requests found
...@@ -109,9 +109,9 @@ func PrintDisassembled(code string) error { ...@@ -109,9 +109,9 @@ func PrintDisassembled(code string) error {
it := NewInstructionIterator(script) it := NewInstructionIterator(script)
for it.Next() { for it.Next() {
if it.Arg() != nil && 0 < len(it.Arg()) { if it.Arg() != nil && 0 < len(it.Arg()) {
fmt.Printf("%06v: %v 0x%x\n", it.PC(), it.Op(), it.Arg()) fmt.Printf("%05x: %v 0x%x\n", it.PC(), it.Op(), it.Arg())
} else { } else {
fmt.Printf("%06v: %v\n", it.PC(), it.Op()) fmt.Printf("%05x: %v\n", it.PC(), it.Op())
} }
} }
return it.Error() return it.Error()
...@@ -124,9 +124,9 @@ func Disassemble(script []byte) ([]string, error) { ...@@ -124,9 +124,9 @@ func Disassemble(script []byte) ([]string, error) {
it := NewInstructionIterator(script) it := NewInstructionIterator(script)
for it.Next() { for it.Next() {
if it.Arg() != nil && 0 < len(it.Arg()) { if it.Arg() != nil && 0 < len(it.Arg()) {
instrs = append(instrs, fmt.Sprintf("%06v: %v 0x%x\n", it.PC(), it.Op(), it.Arg())) instrs = append(instrs, fmt.Sprintf("%05x: %v 0x%x\n", it.PC(), it.Op(), it.Arg()))
} else { } else {
instrs = append(instrs, fmt.Sprintf("%06v: %v\n", it.PC(), it.Op())) instrs = append(instrs, fmt.Sprintf("%05x: %v\n", it.PC(), it.Op()))
} }
} }
if err := it.Error(); err != nil { if err := it.Error(); err != nil {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment