Check gas in sys_stop (#1297)

This commit is contained in:
Robin Salen 2023-10-19 07:55:39 -04:00 committed by GitHub
parent 817e3e78e0
commit 49976ea2a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,6 +6,10 @@ global sys_stop:
// Set the parent context's return data size to 0.
%mstore_parent_context_metadata(@CTX_METADATA_RETURNDATA_SIZE, 0)
// This makes sure the gas used hasn't overflowed the gaslimit.
// This could happen when executing a native instruction (i.e. not a syscall).
%charge_gas_const(0)
%leftover_gas
// stack: leftover_gas
PUSH 1 // success