diff options
author | chriseth <c@ethdev.com> | 2015-08-05 23:19:19 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-08-05 23:19:19 +0800 |
commit | 4ce09762c738bb69daa2537892527952fcfe6d7f (patch) | |
tree | 8b68b4dfd4dce197e65d7d10fe72d8c14a347852 /CompilerUtils.cpp | |
parent | 3380c7c6c9d900b1392812dff009bf524c1a7e53 (diff) | |
parent | 56d5c3310628a1e90225062f0ed21c8378678d09 (diff) | |
download | dexon-solidity-4ce09762c738bb69daa2537892527952fcfe6d7f.tar dexon-solidity-4ce09762c738bb69daa2537892527952fcfe6d7f.tar.gz dexon-solidity-4ce09762c738bb69daa2537892527952fcfe6d7f.tar.bz2 dexon-solidity-4ce09762c738bb69daa2537892527952fcfe6d7f.tar.lz dexon-solidity-4ce09762c738bb69daa2537892527952fcfe6d7f.tar.xz dexon-solidity-4ce09762c738bb69daa2537892527952fcfe6d7f.tar.zst dexon-solidity-4ce09762c738bb69daa2537892527952fcfe6d7f.zip |
Merge pull request #2688 from chriseth/toBytesConversion
Allow explicit conversions bytes <-> string.
Diffstat (limited to 'CompilerUtils.cpp')
-rw-r--r-- | CompilerUtils.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/CompilerUtils.cpp b/CompilerUtils.cpp index e62f59e2..49247581 100644 --- a/CompilerUtils.cpp +++ b/CompilerUtils.cpp @@ -404,7 +404,7 @@ void CompilerUtils::convertType(Type const& _typeOnStack, Type const& _targetTyp case DataLocation::Storage: // Other cases are done explicitly in LValue::storeValue, and only possible by assignment. solAssert( - targetType.isPointer() && + (targetType.isPointer() || (typeOnStack.isByteArray() && targetType.isByteArray())) && typeOnStack.location() == DataLocation::Storage, "Invalid conversion to storage type." ); @@ -469,6 +469,13 @@ void CompilerUtils::convertType(Type const& _typeOnStack, Type const& _targetTyp } break; } + case DataLocation::CallData: + solAssert( + targetType.isByteArray() && + typeOnStack.isByteArray() && + typeOnStack.location() == DataLocation::CallData, + "Invalid conversion to calldata type."); + break; default: solAssert( false, |