diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2016-10-20 19:30:04 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2016-11-15 18:30:12 +0800 |
commit | 91367234d946266b73a5ace8071b0fd931f3a74b (patch) | |
tree | 331d9269a5919c08030c366dbf3a4d47151a3532 | |
parent | 028ab1fbfbe7d83cb5fbf4be9e2eb29a22d5b687 (diff) | |
download | dexon-solidity-91367234d946266b73a5ace8071b0fd931f3a74b.tar.gz dexon-solidity-91367234d946266b73a5ace8071b0fd931f3a74b.tar.zst dexon-solidity-91367234d946266b73a5ace8071b0fd931f3a74b.zip |
Support ErrorTag as a jump label in inline assembly
-rw-r--r-- | Changelog.md | 1 | ||||
-rw-r--r-- | libsolidity/inlineasm/AsmCodeGen.cpp | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/Changelog.md b/Changelog.md index 4d68fc69..d5f8cea9 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,7 @@ Features: * Do-while loops: support for a C-style do{<block>}while(<expr>); control structure + * Inline assembly: support ``ErrorTag`` as a jump label. * Type checker: now more eagerly searches for a common type of an inline array with mixed types * Code generator: generates a runtime error when an out-of-range value is converted into an enum type. diff --git a/libsolidity/inlineasm/AsmCodeGen.cpp b/libsolidity/inlineasm/AsmCodeGen.cpp index 76c71048..1b789c5f 100644 --- a/libsolidity/inlineasm/AsmCodeGen.cpp +++ b/libsolidity/inlineasm/AsmCodeGen.cpp @@ -81,7 +81,11 @@ struct GeneratorState class LabelOrganizer: public boost::static_visitor<> { public: - LabelOrganizer(GeneratorState& _state): m_state(_state) {} + LabelOrganizer(GeneratorState& _state): m_state(_state) + { + // Make the Solidity ErrorTag available to inline assembly + m_state.labels.insert(make_pair("ErrorTag", m_state.assembly.errorTag())); + } template <class T> void operator()(T const& /*_item*/) { } |