mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-23 23:25:22 +00:00
vm: pretty-print PUSHINT* opcodes
This commit is contained in:
parent
92ddc474d8
commit
7d08d38cd2
1 changed files with 4 additions and 0 deletions
|
@ -198,6 +198,10 @@ func (v *VM) PrintOps() {
|
|||
desc = fmt.Sprintf("%d local, %d arg", parameter[0], parameter[1])
|
||||
case opcode.SYSCALL:
|
||||
desc = fmt.Sprintf("%q", parameter)
|
||||
case opcode.PUSHINT8, opcode.PUSHINT16, opcode.PUSHINT32,
|
||||
opcode.PUSHINT64, opcode.PUSHINT128, opcode.PUSHINT256:
|
||||
val := bigint.FromBytes(parameter)
|
||||
desc = fmt.Sprintf("%d (%x)", val, parameter)
|
||||
default:
|
||||
if utf8.Valid(parameter) {
|
||||
desc = fmt.Sprintf("%x (%q)", parameter, parameter)
|
||||
|
|
Loading…
Reference in a new issue