Skip to content

Commit

Permalink
fix: returndata buffer emptied on stop (#948)
Browse files Browse the repository at this point in the history
* fix: returndata buffer emptied on stop

* fmt

* Apply suggestions from code review

Co-authored-by: Oba <[email protected]>

---------

Co-authored-by: Oba <[email protected]>
  • Loading branch information
enitrat and obatirou authored Sep 17, 2024
1 parent 9024471 commit cf6cfd4
Show file tree
Hide file tree
Showing 9 changed files with 284 additions and 297 deletions.
3 changes: 1 addition & 2 deletions crates/evm/src/backend/validation.cairo
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use contracts::IKakarotCore;
use contracts::account_contract::{IAccountDispatcher, IAccountDispatcherTrait};
use contracts::kakarot_core::KakarotCore;
use core::ops::SnapshotDeref;
Expand Down Expand Up @@ -78,7 +77,7 @@ mod tests {
use utils::constants::BLOCK_GAS_LIMIT;
use utils::eth_transaction::common::TxKind;
use utils::eth_transaction::eip1559::TxEip1559;
use utils::eth_transaction::transaction::{Transaction, TransactionTrait};
use utils::eth_transaction::transaction::Transaction;

fn set_up() -> KakarotCore::ContractState {
// Define the addresses used in the tests, whose calls will be mocked
Expand Down
4 changes: 3 additions & 1 deletion crates/evm/src/call_helpers.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ pub impl CallHelpersImpl of CallHelpers {
self.stack.push(0)?;
},
ExecutionResultStatus::Exception => {
// If the call has halted exceptionnaly, the return_data is emptied.
// If the call has halted exceptionnaly,
// the return_data is emptied, and nothing is stored in memory
self.return_data = [].span();
self.stack.push(0)?;
return Result::Ok(());
},
}

Expand Down
Loading

0 comments on commit cf6cfd4

Please sign in to comment.