aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-08-07 19:55:40 +0800
committerGitHub <noreply@github.com>2018-08-07 19:55:40 +0800
commit8b2d630275fb29d2915af76f608be4d4e422907f (patch)
treec45a9efcec1e7a769a1a38b9eac8c8a1525fac83 /test
parent261fedd3b04fc67e4359002631d8f6b46032b85f (diff)
parent296ba24f7f14811c5a5482457391d4f1afa49a87 (diff)
downloaddexon-solidity-8b2d630275fb29d2915af76f608be4d4e422907f.tar.gz
dexon-solidity-8b2d630275fb29d2915af76f608be4d4e422907f.tar.zst
dexon-solidity-8b2d630275fb29d2915af76f608be4d4e422907f.zip
Merge pull request #4724 from ethereum/slot-in-assembly
Do not crash on using _slot and _offset suffixes on their own
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/syntaxTests/inlineAssembly/storage_reference_empty_offset.sol9
-rw-r--r--test/libsolidity/syntaxTests/inlineAssembly/storage_reference_empty_slot.sol9
2 files changed, 18 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/inlineAssembly/storage_reference_empty_offset.sol b/test/libsolidity/syntaxTests/inlineAssembly/storage_reference_empty_offset.sol
new file mode 100644
index 00000000..ec23a263
--- /dev/null
+++ b/test/libsolidity/syntaxTests/inlineAssembly/storage_reference_empty_offset.sol
@@ -0,0 +1,9 @@
+contract C {
+ function f() public pure {
+ assembly {
+ _offset
+ }
+ }
+}
+// ----
+// DeclarationError: (75-82): In variable names _slot and _offset can only be used as a suffix.
diff --git a/test/libsolidity/syntaxTests/inlineAssembly/storage_reference_empty_slot.sol b/test/libsolidity/syntaxTests/inlineAssembly/storage_reference_empty_slot.sol
new file mode 100644
index 00000000..d493a68a
--- /dev/null
+++ b/test/libsolidity/syntaxTests/inlineAssembly/storage_reference_empty_slot.sol
@@ -0,0 +1,9 @@
+contract C {
+ function f() public pure {
+ assembly {
+ _slot
+ }
+ }
+}
+// ----
+// DeclarationError: (75-80): In variable names _slot and _offset can only be used as a suffix.