Skip to content

Commit 1548e01

Browse files
r0qsclonker
authored andcommitted
wip
1 parent 28ca802 commit 1548e01

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
@@ -608,9 +608,9 @@ void ArrayUtils::clearArray(ArrayType const& _typeIn) const
608608
ArrayUtils(_context).convertLengthToSize(_type);
609609
_context << Instruction::ADD << Instruction::SWAP1;
610610
if (_type.baseType()->storageBytes() < 32)
611-
ArrayUtils(_context).clearStorageLoop(TypeProvider::uint256(), !_type.isDynamicallySized());
611+
ArrayUtils(_context).clearStorageLoop(TypeProvider::uint256(), /* _canOverflow */ true);
612612
else
613-
ArrayUtils(_context).clearStorageLoop(_type.baseType(), !_type.isDynamicallySized());
613+
ArrayUtils(_context).clearStorageLoop(_type.baseType(), /* _canOverflow */ true);
614614
_context << Instruction::POP;
615615
}
616616
solAssert(_context.stackHeight() == stackHeightStart - 2, "");
@@ -793,7 +793,7 @@ void ArrayUtils::clearStorageLoop(Type const* _type, bool _canOverflow) const
793793
{
794794
solAssert(_type->storageBytes() >= 32, "");
795795
m_context.callLowLevelFunction(
796-
"$clearStorageLoop_" + _type->identifier() + (_canOverflow ? "_canOverflow" : "cannotOverflow"),
796+
"$clearStorageLoop_" + _type->identifier() + (_canOverflow ? "_canOverflow" : "_cannotOverflow"),
797797
2,
798798
1,
799799
[_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)