mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-04 06:43:07 +00:00
Fix return and revert gas (#1058)
This commit is contained in:
parent
42f3301730
commit
7dfdacf247
@ -16,8 +16,13 @@ global sys_return:
|
||||
%stack (kexit_info, offset, size) -> (offset, size, kexit_info, offset, size)
|
||||
%add_or_fault
|
||||
DUP1 %ensure_reasonable_offset
|
||||
// stack: offset+size, kexit_info, offset, size
|
||||
DUP4 ISZERO %jumpi(return_zero_size)
|
||||
%update_mem_bytes
|
||||
|
||||
%jump(return_after_gas)
|
||||
return_zero_size:
|
||||
POP
|
||||
return_after_gas:
|
||||
// Load the parent's context.
|
||||
%mload_context_metadata(@CTX_METADATA_PARENT_CONTEXT)
|
||||
|
||||
@ -115,6 +120,13 @@ global sys_revert:
|
||||
%stack (kexit_info, offset, size) -> (offset, size, kexit_info, offset, size)
|
||||
%add_or_fault
|
||||
DUP1 %ensure_reasonable_offset
|
||||
// stack: offset+size, kexit_info, offset, size
|
||||
DUP4 ISZERO %jumpi(revert_zero_size)
|
||||
%update_mem_bytes
|
||||
%jump(revert_after_gas)
|
||||
revert_zero_size:
|
||||
POP
|
||||
revert_after_gas:
|
||||
%update_mem_bytes
|
||||
|
||||
// Load the parent's context.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user