Skip to content

Commit 935a52f

Browse files
committed
wip
1 parent 07e67a8 commit 935a52f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

libsolidity/codegen/ArrayUtils.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -641,9 +641,9 @@ void ArrayUtils::clearArray(ArrayType const& _typeIn) const
641641
ArrayUtils(_context).convertLengthToSize(_type);
642642
_context << Instruction::ADD << Instruction::SWAP1;
643643
if (_type.baseType()->storageBytes() < 32)
644-
ArrayUtils(_context).clearStorageLoop(TypeProvider::uint256(), !_type.isDynamicallySized());
644+
ArrayUtils(_context).clearStorageLoop(TypeProvider::uint256(), /* _canOverflow */ true);
645645
else
646-
ArrayUtils(_context).clearStorageLoop(_type.baseType(), !_type.isDynamicallySized());
646+
ArrayUtils(_context).clearStorageLoop(_type.baseType(), /* _canOverflow */ true);
647647
_context << Instruction::POP;
648648
}
649649
solAssert(_context.stackHeight() == stackHeightStart - 2, "");
@@ -826,7 +826,7 @@ void ArrayUtils::clearStorageLoop(Type const* _type, bool _canOverflow) const
826826
{
827827
solAssert(_type->storageBytes() >= 32, "");
828828
m_context.callLowLevelFunction(
829-
"$clearStorageLoop_" + _type->identifier() + (_canOverflow ? "_canOverflow" : "cannotOverflow"),
829+
"$clearStorageLoop_" + _type->identifier() + (_canOverflow ? "_canOverflow" : "_cannotOverflow"),
830830
2,
831831
1,
832832
[_type, _canOverflow](CompilerContext& _context)

libsolidity/codegen/YulUtilFunctions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1822,7 +1822,7 @@ std::string YulUtilFunctions::clearStorageRangeFunction(Type const& _type, bool
18221822
if (_type.storageBytes() < 32)
18231823
solAssert(_type.isValueType(), "");
18241824

1825-
std::string functionName = "clear_storage_range_" + _type.identifier();
1825+
std::string functionName = "clear_storage_range_" + _type.identifier() + (_canOverflow ? "_canOverflow" : "_cannotOverflow");
18261826

18271827
return m_functionCollector.createFunction(functionName, [&]() {
18281828
return Whiskers(R"(

test/libsolidity/semanticTests/array/arrays_complex_from_and_to_storage.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ contract Test {
1414
// set(uint24[3][]): 0x20, 0x06, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12 -> 0x06
1515
// gas irOptimized: 185216
1616
// gas legacy: 211036
17-
// gas legacyOptimized: 206077
17+
// gas legacyOptimized: 205741
1818
// data(uint256,uint256): 0x02, 0x02 -> 0x09
1919
// data(uint256,uint256): 0x05, 0x01 -> 0x11
2020
// data(uint256,uint256): 0x06, 0x00 -> FAILURE

0 commit comments

Comments
 (0)