From 296ba24f7f14811c5a5482457391d4f1afa49a87 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 7 Aug 2018 11:23:00 +0100 Subject: Do not crash on using _slot and _offset suffixes on their own --- .../inlineAssembly/storage_reference_empty_offset.sol | 9 +++++++++ .../syntaxTests/inlineAssembly/storage_reference_empty_slot.sol | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 test/libsolidity/syntaxTests/inlineAssembly/storage_reference_empty_offset.sol create mode 100644 test/libsolidity/syntaxTests/inlineAssembly/storage_reference_empty_slot.sol (limited to 'test') 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. -- cgit v1.2.3