@@ -360,7 +360,8 @@ def test_callf_sneaky_stack_overflow(
360
360
("stack_height" , "failure" ),
361
361
(
362
362
pytest .param (1018 , False , id = "no_max_stack" ),
363
- pytest .param (1019 , True , id = "with_max_stack" ),
363
+ pytest .param (1019 , False , id = "with_max_stack" ),
364
+ pytest .param (1020 , True , id = "over_max_stack" ),
364
365
),
365
366
)
366
367
def test_callf_max_stack (
@@ -374,11 +375,13 @@ def test_callf_max_stack(
374
375
375
376
Code Section 0 - calls #1 with the configured height, but we load some operands so the
376
377
return stack does not overflow
377
- Code Section 1 - recursively calls itself until input is zero, then calls 2 and returns.
378
+ Code Section 1 - expands stack, calls #2, THEN recursively calls itself until input is zero,
379
+ and returns.
378
380
Code Section 2 - Just returns, zero inputs, zero outputs
379
381
380
- This will catch CALLF rule #4: always fail if the operand stack is full. Not checking
381
- rule 4 results in a call to section 2 and not overfilling the stack (as it is just RETF).
382
+ This will catch CALLF execution rule #3: always fail if the operand stack is full. Not
383
+ checking rule 3 results in a call to section 2 and not overfilling the stack (as it is just
384
+ RETF).
382
385
"""
383
386
env = Environment ()
384
387
sender = pre .fund_eoa ()
0 commit comments