aboutsummaryrefslogtreecommitdiffstats
path: root/Assembly.h
diff options
context:
space:
mode:
Diffstat (limited to 'Assembly.h')
-rw-r--r--Assembly.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/Assembly.h b/Assembly.h
index b4850f7d..4550eb6e 100644
--- a/Assembly.h
+++ b/Assembly.h
@@ -67,6 +67,8 @@ public:
AssemblyItem appendJumpI() { auto ret = append(newPushTag()); append(Instruction::JUMPI); return ret; }
AssemblyItem appendJump(AssemblyItem const& _tag) { auto ret = append(_tag.pushTag()); append(Instruction::JUMP); return ret; }
AssemblyItem appendJumpI(AssemblyItem const& _tag) { auto ret = append(_tag.pushTag()); append(Instruction::JUMPI); return ret; }
+ AssemblyItem errorTag() { return AssemblyItem(PushTag, 0); }
+
template <class T> Assembly& operator<<(T const& _d) { append(_d); return *this; }
AssemblyItems const& getItems() const { return m_items; }
AssemblyItem const& back() const { return m_items.back(); }
@@ -97,7 +99,6 @@ public:
const StringMap &_sourceCodes = StringMap(),
bool _inJsonFormat = false
) const;
-
protected:
std::string getLocationFromSources(StringMap const& _sourceCodes, SourceLocation const& _location) const;
void donePath() { if (m_totalDeposit != INT_MAX && m_totalDeposit != m_deposit) BOOST_THROW_EXCEPTION(InvalidDeposit()); }
@@ -109,7 +110,8 @@ private:
Json::Value createJsonValue(std::string _name, int _begin, int _end, std::string _value = std::string(), std::string _jumpType = std::string()) const;
protected:
- unsigned m_usedTags = 0;
+ // 0 is reserved for exception
+ unsigned m_usedTags = 1;
AssemblyItems m_items;
mutable std::map<h256, bytes> m_data;
std::vector<Assembly> m_subs;