vm: return NOP as current instruction for just loaded VM

Before:
NEO-GO-VM > loadgo h.go
READY: loaded 16 instructions
NEO-GO-VM > ip
instruction pointer at -1 (PUSH0)

After:
NEO-GO-VM > loadgo h.go
READY: loaded 16 instructions
NEO-GO-VM > ip
instruction pointer at -1 (NOP)

I think NOP is a little less scary.
This commit is contained in:
Roman Khimov 2019-09-10 19:17:33 +03:00
parent e872b6b421
commit 5bd666b786

View file

@ -49,7 +49,7 @@ func (c *Context) LenInstr() int {
// CurrInstr returns the current instruction and opcode.
func (c *Context) CurrInstr() (int, Instruction) {
if c.ip < 0 {
return c.ip, Instruction(0x00)
return c.ip, NOP
}
return c.ip, Instruction(c.prog[c.ip])
}