mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix ICE when pop dyn storage array of mapping
This commit is contained in:
@@ -896,11 +896,16 @@ void ArrayUtils::popStorageArrayElement(ArrayType const& _type) const
|
||||
// Stack: ArrayReference oldLength
|
||||
m_context << u256(1) << Instruction::SWAP1 << Instruction::SUB;
|
||||
// Stack ArrayReference newLength
|
||||
m_context << Instruction::DUP2 << Instruction::DUP2;
|
||||
// Stack ArrayReference newLength ArrayReference newLength;
|
||||
accessIndex(_type, false);
|
||||
// Stack: ArrayReference newLength storage_slot byte_offset
|
||||
StorageItem(m_context, *_type.baseType()).setToZero(SourceLocation(), true);
|
||||
|
||||
if (_type.baseType()->category() != Type::Category::Mapping)
|
||||
{
|
||||
m_context << Instruction::DUP2 << Instruction::DUP2;
|
||||
// Stack ArrayReference newLength ArrayReference newLength;
|
||||
accessIndex(_type, false);
|
||||
// Stack: ArrayReference newLength storage_slot byte_offset
|
||||
StorageItem(m_context, *_type.baseType()).setToZero(SourceLocation(), true);
|
||||
}
|
||||
|
||||
// Stack: ArrayReference newLength
|
||||
m_context << Instruction::SWAP1 << Instruction::SSTORE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user