Skip to content

Commit dcae3ce

Browse files
committed
Fix save address and bytes32
1 parent 8d18380 commit dcae3ce

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

src/L2Compressor.huff

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -177,16 +177,14 @@
177177
0x60 shr // [addr, windex, rindex]
178178
PULL_ADDRESS() ADDRESS_STORAGE_POINTER() sstore // [windex, rindex]
179179

180-
// Add 20 bytes to both indexes
181-
182-
0x14 dup1 // [0x14, 0x14, windex, rindex]
183-
swap3 // [rindex, 0x14, windex, 0x14]
184-
add // [windex + 0x14, 0x14, rindex]
180+
// Add 32 bytes to both indexes
185181

186-
swap2 // [rindex, 0x14, windex + 0x14]
187-
add // [rindex + 0x14, windex + 0x14]
182+
0x20 dup1 // [0x20, 0x20, windex, rindex]
183+
swap3 // [rindex, 0x20, windex, 0x20]
184+
add // [rindex + 0x20, 0x20, windex]
188185

189-
swap1 // [windex + 0x14, rindex + 0x14]
186+
swap2 // [windex, 0x20, rindex + 0x20]
187+
add // [windex + 0x20, rindex + 0x20]
190188

191189
// output stack: [windex + 20, rindex + 20]
192190
}
@@ -201,8 +199,8 @@
201199

202200
FLAG_SAVE_ADDRESS() // [windex, rindex]
203201

204-
0x15 eq ASSERT() // [rindex]
205-
0x34 eq ASSERT() // []
202+
0x40 eq ASSERT() // [rindex]
203+
0x21 eq ASSERT() // []
206204

207205
// Validate that memory was written correctly
208206

@@ -238,12 +236,10 @@
238236

239237
0x20 dup1 // [0x20, 0x20, windex, rindex]
240238
swap3 // [rindex, 0x20, windex, 0x20]
241-
add // [windex + 0x20, 0x20, rindex]
239+
add // [rindex + 0x20, 0x20, windex]
242240

243-
swap2 // [rindex, 0x20, windex + 0x20]
244-
add // [rindex + 0x20, windex + 0x20]
245-
246-
swap1 // [windex + 0x20, rindex + 0x20]
241+
swap2 // [windex, 0x20, rindex + 0x20]
242+
add // [windex + 0x20, rindex + 0x20]
247243

248244
// output stack: [windex + 32, rindex + 32]
249245
}
@@ -257,8 +253,8 @@
257253

258254
FLAG_SAVE_BYTES32() // [windex, rindex]
259255

260-
0x21 eq ASSERT() // [rindex]
261256
0x40 eq ASSERT() // []
257+
0x21 eq ASSERT() // [rindex]
262258

263259
// Validate that memory was written correctly
264260

0 commit comments

Comments
 (0)