diff options
author | chriseth <chris@ethereum.org> | 2017-07-12 21:02:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-12 21:02:20 +0800 |
commit | fca8d781b4490026dce657fd344a1fe36c9179f2 (patch) | |
tree | 3649410bfcc79fcf8221b9094cdc0bd79474506c /test | |
parent | b981ef2055cd8aa0bb1c6d4a58d547c78c509128 (diff) | |
parent | db7ad508f8ad33389ae507967aebc05aaf31b94b (diff) | |
download | dexon-solidity-fca8d781b4490026dce657fd344a1fe36c9179f2.tar dexon-solidity-fca8d781b4490026dce657fd344a1fe36c9179f2.tar.gz dexon-solidity-fca8d781b4490026dce657fd344a1fe36c9179f2.tar.bz2 dexon-solidity-fca8d781b4490026dce657fd344a1fe36c9179f2.tar.lz dexon-solidity-fca8d781b4490026dce657fd344a1fe36c9179f2.tar.xz dexon-solidity-fca8d781b4490026dce657fd344a1fe36c9179f2.tar.zst dexon-solidity-fca8d781b4490026dce657fd344a1fe36c9179f2.zip |
Merge pull request #2556 from ethereum/inlineasm-calldata
Issue proper warning trying to access calldata variables in inline assembly
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 637ff5cc..2ee5baac 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -5428,6 +5428,20 @@ BOOST_AUTO_TEST_CASE(inline_assembly_storage_variable_access_out_of_functions) CHECK_SUCCESS_NO_WARNINGS(text); } +BOOST_AUTO_TEST_CASE(inline_assembly_calldata_variables) +{ + char const* text = R"( + contract C { + function f(bytes bytesAsCalldata) external { + assembly { + let x := bytesAsCalldata + } + } + } + )"; + CHECK_ERROR(text, TypeError, "Call data elements cannot be accessed directly."); +} + BOOST_AUTO_TEST_CASE(invalid_mobile_type) { char const* text = R"( |