This repository was archived by the owner on Sep 8, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +9
-7
lines changed Expand file tree Collapse file tree 4 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 2222 opcode_values .JUMPSUB : as_opcode (
2323 logic_fn = flow .jumpsub ,
2424 mnemonic = mnemonics .JUMPSUB ,
25- gas_cost = constants .GAS_MID ,
25+ gas_cost = constants .GAS_HIGH ,
2626 ),
2727 opcode_values .RETURNSUB : as_opcode (
2828 logic_fn = flow .returnsub ,
2929 mnemonic = mnemonics .RETURNSUB ,
30- gas_cost = constants .GAS_VERYLOW ,
30+ gas_cost = constants .GAS_LOW ,
3131 ),
3232}
3333
Original file line number Diff line number Diff line change @@ -71,20 +71,19 @@ def jumpsub(computation: BaseComputation) -> None:
7171
7272 if computation .code .is_valid_opcode (sub_loc ):
7373
74- sub_op = computation .code . is_valid_opcode ( sub_loc )
74+ sub_op = computation .code [ sub_loc ]
7575
7676 if sub_op == BEGINSUB :
7777 temp = computation .code .program_counter
7878 computation .code .program_counter = sub_loc + 1
79- computation .rstack_push_int (temp + 1 )
79+ computation .rstack_push_int (temp )
8080
8181
8282def returnsub (computation : BaseComputation ) -> None :
83-
8483 try :
8584 ret_loc = computation .rstack_pop1_int ()
8685 except InsufficientStack :
87- pass
86+ raise InsufficientStack ( "Error: at pc={}, op=RETURNSUB: invalid retsub" . format ( computation . code . program_counter ))
8887
8988
9089 computation .code .program_counter = ret_loc
Original file line number Diff line number Diff line change 9191MSIZE = 0x59
9292GAS = 0x5a
9393JUMPDEST = 0x5b
94+
95+
9496#
9597# Subroutines
9698#
9799BEGINSUB = 0x5c
98100RETURNSUB = 0x5d
99101JUMPSUB = 0x5e
100102
103+
101104#
102105# Push Operations
103106#
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ def __init__(self) -> None:
3636 self ._pop_typed = values .pop
3737 self .__len__ = values .__len__
3838
39- def push_int (self ) -> int :
39+ def push_int (self , value ) -> int :
4040 if len (self .values ) > 1023 :
4141 raise FullStack ('Stack limit reached' )
4242
You can’t perform that action at this time.
0 commit comments