aboutsummaryrefslogtreecommitdiffstats
path: root/Assembly.h
diff options
context:
space:
mode:
authorLiana Husikyan <liana@ethdev.com>2015-05-15 18:23:13 +0800
committerLiana Husikyan <liana@ethdev.com>2015-06-01 19:06:12 +0800
commit25205cb05b068e0ec116bdc3f8230f9f2f2159f0 (patch)
tree7f59715c530d13cb9e17a16ce3060df1445c65d2 /Assembly.h
parent7f55e26eb8fd9c321c679f7e4c758070b8d670c1 (diff)
downloaddexon-solidity-25205cb05b068e0ec116bdc3f8230f9f2f2159f0.tar.gz
dexon-solidity-25205cb05b068e0ec116bdc3f8230f9f2f2159f0.tar.zst
dexon-solidity-25205cb05b068e0ec116bdc3f8230f9f2f2159f0.zip
added error jump instead of STOP instraction in case of exception
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;