Browse Source

Fixes after rebasing on top of develop

cl-refactor
Lefteris Karapetsas 10 years ago
parent
commit
4700b1b2c8
  1. 2
      libsolidity/AST.cpp
  2. 3
      libsolidity/CompilerUtils.cpp
  3. 2
      libsolidity/LValue.cpp

2
libsolidity/AST.cpp

@ -671,7 +671,7 @@ void IndexAccess::checkTypeRequirements()
BOOST_THROW_EXCEPTION(createTypeError("Index expression cannot be omitted.")); BOOST_THROW_EXCEPTION(createTypeError("Index expression cannot be omitted."));
m_index->expectType(IntegerType(256)); m_index->expectType(IntegerType(256));
if (type.isByteArray()) if (type.isByteArray())
m_type = make_shared<IntegerType>(8, IntegerType::Modifier::Hash); m_type = make_shared<FixedBytesType>(1);
else else
m_type = type.getBaseType(); m_type = type.getBaseType();
m_isLValue = type.getLocation() != ArrayType::Location::CallData; m_isLValue = type.getLocation() != ArrayType::Location::CallData;

3
libsolidity/CompilerUtils.cpp

@ -177,8 +177,7 @@ void CompilerUtils::computeHashStatic(Type const& _type, bool _padToWordBoundari
unsigned CompilerUtils::loadFromMemoryHelper(Type const& _type, bool _fromCalldata, bool _padToWordBoundaries) unsigned CompilerUtils::loadFromMemoryHelper(Type const& _type, bool _fromCalldata, bool _padToWordBoundaries)
{ {
unsigned _encodedSize = _type.getCalldataEncodedSize(); unsigned numBytes = _type.getCalldataEncodedSize(_padToWordBoundaries);
unsigned numBytes = _padToWordBoundaries ? getPaddedSize(_encodedSize) : _encodedSize;
bool leftAligned = _type.getCategory() == Type::Category::FixedBytes; bool leftAligned = _type.getCategory() == Type::Category::FixedBytes;
if (numBytes == 0) if (numBytes == 0)
m_context << eth::Instruction::POP << u256(0); m_context << eth::Instruction::POP << u256(0);

2
libsolidity/LValue.cpp

@ -234,7 +234,7 @@ void StorageItem::setToZero(SourceLocation const&, bool _removeReference) const
} }
/// Used in StorageByteArrayElement /// Used in StorageByteArrayElement
static IntegerType byteType(8, IntegerType::Modifier::Hash); static FixedBytesType byteType(1);
StorageByteArrayElement::StorageByteArrayElement(CompilerContext& _compilerContext): StorageByteArrayElement::StorageByteArrayElement(CompilerContext& _compilerContext):
LValue(_compilerContext, byteType) LValue(_compilerContext, byteType)

Loading…
Cancel
Save