mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 01:41:48 +00:00
vm: fix TRY offsets check
TRY can have an offset != 0 and still it can't have both parameters set to zero.
This commit is contained in:
parent
32112249d5
commit
681ae4d5d6
2 changed files with 6 additions and 2 deletions
|
@ -1296,7 +1296,11 @@ func TestTRY(t *testing.T) {
|
|||
add5 := []byte{byte(opcode.PUSH5), byte(opcode.ADD)}
|
||||
add9 := []byte{byte(opcode.PUSH9), byte(opcode.ADD)}
|
||||
t.Run("NoCatch", func(t *testing.T) {
|
||||
t.Run("NoFinally", getTRYTestFunc(nil, push1, nil, nil))
|
||||
t.Run("NoFinally", func(t *testing.T) {
|
||||
prog := getTRYProgram(push1, nil, nil)
|
||||
vm := load(prog)
|
||||
checkVMFailed(t, vm)
|
||||
})
|
||||
t.Run("WithFinally", getTRYTestFunc(10, push1, nil, add9))
|
||||
t.Run("Throw", getTRYTestFunc(nil, throw, nil, add9))
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue