Skip to content

Commit

Permalink
Merge pull request #684 from g-r-a-n-t/bugfix
Browse files Browse the repository at this point in the history
fixed memory bug in storage maps
  • Loading branch information
g-r-a-n-t authored Mar 8, 2022
2 parents a86a9fb + 16ea2a9 commit d92cd20
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/yulgen/src/runtime/functions/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ pub fn alloc_mstoren() -> yul::Statement {
pub fn map_value_ptr() -> yul::Statement {
function_definition! {
function map_value_ptr(a, b) -> return_val {
(let ptr := avail())
(let ptr := alloc(64))
(mstore(ptr, a))
(mstore((add(ptr, 32)), b))
(let hash := keccak256(ptr, 64))
Expand Down
1 change: 1 addition & 0 deletions newsfragments/684.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The region of memory used to compute the slot of a storage map value was not being allocated.

0 comments on commit d92cd20

Please sign in to comment.