vm: pretty-print ST*/LD* opcodes

This commit is contained in:
Evgenii Stratonikov 2020-07-25 09:50:09 +03:00
parent 7d08d38cd2
commit 9cc6e22365

View file

@ -202,6 +202,8 @@ func (v *VM) PrintOps() {
opcode.PUSHINT64, opcode.PUSHINT128, opcode.PUSHINT256:
val := bigint.FromBytes(parameter)
desc = fmt.Sprintf("%d (%x)", val, parameter)
case opcode.LDLOC, opcode.STLOC, opcode.LDARG, opcode.STARG, opcode.LDSFLD, opcode.STSFLD:
desc = fmt.Sprintf("%d (%x)", parameter[0], parameter)
default:
if utf8.Valid(parameter) {
desc = fmt.Sprintf("%x (%q)", parameter, parameter)