mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-07 23:10:32 +00:00
vm: support exceptions
Implement 3 new instructions: TRY,ENDTRY,ENDFINALLY. 1. TRY marks the start of the block where exceptions are catched. It has 2 arguments which are relative offsets of exception handler and the end of the whole try/catch construction. 2. ENDTRY denotes either end of try or catch block. 3. ENDFINALLY denotes end of finally block which is executed irregardless of whether an exception has occured.
This commit is contained in:
parent
c0d7b9d234
commit
797324cb04
6 changed files with 415 additions and 139 deletions
|
@ -68,9 +68,14 @@ const (
|
|||
CALLA Opcode = 0x36
|
||||
|
||||
// Exceptions
|
||||
ABORT Opcode = 0x37
|
||||
ASSERT Opcode = 0x38
|
||||
THROW Opcode = 0x3A
|
||||
ABORT Opcode = 0x37
|
||||
ASSERT Opcode = 0x38
|
||||
THROW Opcode = 0x3A
|
||||
TRY Opcode = 0x3B
|
||||
TRYL Opcode = 0x3C // TRY_L
|
||||
ENDTRY Opcode = 0x3D
|
||||
ENDTRYL Opcode = 0x3E // ENDTRY_L
|
||||
ENDFINALLY Opcode = 0x3F
|
||||
|
||||
RET Opcode = 0x40
|
||||
SYSCALL Opcode = 0x41
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue