Skip to content

Commit d92cd20

Browse files
authored
Merge pull request #684 from g-r-a-n-t/bugfix
fixed memory bug in storage maps
2 parents a86a9fb + 16ea2a9 commit d92cd20

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

crates/yulgen/src/runtime/functions/data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ pub fn alloc_mstoren() -> yul::Statement {
350350
pub fn map_value_ptr() -> yul::Statement {
351351
function_definition! {
352352
function map_value_ptr(a, b) -> return_val {
353-
(let ptr := avail())
353+
(let ptr := alloc(64))
354354
(mstore(ptr, a))
355355
(mstore((add(ptr, 32)), b))
356356
(let hash := keccak256(ptr, 64))

newsfragments/684.bugfix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The region of memory used to compute the slot of a storage map value was not being allocated.

0 commit comments

Comments
 (0)