Skip to content

Commit 97b2806

Browse files
gballetkaralabe
authored andcommitted
core/asm: Use hexadecimal addresses in assembly dumps (#17870)
1 parent 11d0ff6 commit 97b2806

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/asm/asm.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ func PrintDisassembled(code string) error {
109109
it := NewInstructionIterator(script)
110110
for it.Next() {
111111
if it.Arg() != nil && 0 < len(it.Arg()) {
112-
fmt.Printf("%06v: %v 0x%x\n", it.PC(), it.Op(), it.Arg())
112+
fmt.Printf("%05x: %v 0x%x\n", it.PC(), it.Op(), it.Arg())
113113
} else {
114-
fmt.Printf("%06v: %v\n", it.PC(), it.Op())
114+
fmt.Printf("%05x: %v\n", it.PC(), it.Op())
115115
}
116116
}
117117
return it.Error()
@@ -124,9 +124,9 @@ func Disassemble(script []byte) ([]string, error) {
124124
it := NewInstructionIterator(script)
125125
for it.Next() {
126126
if it.Arg() != nil && 0 < len(it.Arg()) {
127-
instrs = append(instrs, fmt.Sprintf("%06v: %v 0x%x\n", it.PC(), it.Op(), it.Arg()))
127+
instrs = append(instrs, fmt.Sprintf("%05x: %v 0x%x\n", it.PC(), it.Op(), it.Arg()))
128128
} else {
129-
instrs = append(instrs, fmt.Sprintf("%06v: %v\n", it.PC(), it.Op()))
129+
instrs = append(instrs, fmt.Sprintf("%05x: %v\n", it.PC(), it.Op()))
130130
}
131131
}
132132
if err := it.Error(); err != nil {

0 commit comments

Comments
 (0)