diff options
author | chriseth <c@ethdev.com> | 2015-06-16 23:20:41 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-06-16 23:20:41 +0800 |
commit | 17efc422996979289a9c5aa02959066578b09aa8 (patch) | |
tree | 9ed79bf8f04b4bf2d16119c94a807bbbe7efd70a /CompilerUtils.cpp | |
parent | a5664d053589bb512c1b9acba7feb6b1c6db155f (diff) | |
download | dexon-solidity-17efc422996979289a9c5aa02959066578b09aa8.tar.gz dexon-solidity-17efc422996979289a9c5aa02959066578b09aa8.tar.zst dexon-solidity-17efc422996979289a9c5aa02959066578b09aa8.zip |
Type conversion specialities for storage references.
Diffstat (limited to 'CompilerUtils.cpp')
-rw-r--r-- | CompilerUtils.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/CompilerUtils.cpp b/CompilerUtils.cpp index 349877a2..d4e705a3 100644 --- a/CompilerUtils.cpp +++ b/CompilerUtils.cpp @@ -274,10 +274,13 @@ void CompilerUtils::encodeToMemory( else { copyToStackTop(argSize - stackPos + dynPointers + 2, _givenTypes[i]->getSizeOnStack()); - if (targetType->isValueType()) - convertType(*_givenTypes[i], *targetType, true); solAssert(!!targetType, "Externalable type expected."); - storeInMemoryDynamic(*targetType, _padToWordBoundaries); + TypePointer type = targetType; + if (_givenTypes[i]->isInStorage()) + type = _givenTypes[i]; // delay conversion + else + convertType(*_givenTypes[i], *targetType, true); + storeInMemoryDynamic(*type, _padToWordBoundaries); } stackPos += _givenTypes[i]->getSizeOnStack(); } |