Skip to content

Commit db85849

Browse files
authored
Merge pull request #11737 from ethereum/fix_shift_cleanup
Yul: Fix cleanup for left shift of bytes types.
2 parents 35e1ab2 + 0112fed commit db85849

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libsolidity/codegen/YulUtilFunctions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ string YulUtilFunctions::typedShiftLeftFunction(Type const& _type, Type const& _
445445
Whiskers(R"(
446446
function <functionName>(value, bits) -> result {
447447
bits := <cleanAmount>(bits)
448-
result := <cleanup>(<shift>(bits, value))
448+
result := <cleanup>(<shift>(bits, <cleanup>(value)))
449449
}
450450
)")
451451
("functionName", functionName)

test/libsolidity/semanticTests/operators/shifts/shift_bytes_cleanup_viaYul.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ contract C {
1313
}
1414
}
1515
// ====
16-
// compileViaYul: true
1716
// compileToEwasm: also
17+
// compileViaYul: true
1818
// ----
19-
// l(uint8): 64 -> 0x3930313233343536373839306162636465000000000000000000000000000000
19+
// l(uint8): 64 -> 0x3930313233343536373839300000000000000000000000000000000000000000
2020
// r(uint8): 64 -> 0x313233343536373839303132000000000000000000000000

0 commit comments

Comments
 (0)