Support ErrorTag as a jump label in inline assembly

This commit is contained in:
Alex Beregszaszi 2016-10-20 12:30:04 +01:00
parent 028ab1fbfb
commit 91367234d9
2 changed files with 6 additions and 1 deletions

View File

@ -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.

View File

@ -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*/) { }