aboutsummaryrefslogtreecommitdiffstats
path: root/CompilerUtils.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-06-16 23:20:41 +0800
committerchriseth <c@ethdev.com>2015-06-16 23:20:41 +0800
commit17efc422996979289a9c5aa02959066578b09aa8 (patch)
tree9ed79bf8f04b4bf2d16119c94a807bbbe7efd70a /CompilerUtils.cpp
parenta5664d053589bb512c1b9acba7feb6b1c6db155f (diff)
downloaddexon-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.cpp9
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();
}