vm: check return value on context unload
When calling external contracts we expect exactly 1 value to be on stack. For methods returning nothing, `Null` value is pushed, otherwise it is an error.`
This commit is contained in:
parent
bbae7318a5
commit
bf01599430
6 changed files with 57 additions and 0 deletions
|
@ -519,6 +519,7 @@ func contractCallExInternal(ic *interop.Context, h []byte, name string, args []s
|
|||
}
|
||||
// use Jump not Call here because context was loaded in LoadScript above.
|
||||
ic.VM.Jump(ic.VM.Context(), md.Offset)
|
||||
ic.VM.Context().CheckReturn = true
|
||||
}
|
||||
|
||||
md = cs.Manifest.ABI.GetMethod(manifest.MethodInit)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue