Skip to content

Commit

Permalink
fix(levm): clear sub_return_data in generic_call() (#1553)
Browse files Browse the repository at this point in the history
**Motivation**

Ensure the `sub_return_data` is cleared at the start of every
`generic_call()`

**Description**

Added a step to clear the `sub_return_data` with empty bytes. This
change prevents residual data from previous calls.
  • Loading branch information
damiramirez authored Dec 20, 2024
1 parent ef1f3a1 commit cd58549
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/vm/levm/src/opcode_handlers/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,9 @@ impl VM {
ret_offset: U256,
ret_size: usize,
) -> Result<OpcodeSuccess, VMError> {
// Clear callframe subreturn data
current_call_frame.sub_return_data = Bytes::new();

// 1. Validate sender has enough value
let sender_account_info = self.access_account(msg_sender).0;
if should_transfer_value && sender_account_info.balance < value {
Expand Down

0 comments on commit cd58549

Please sign in to comment.