diff options
author | Gav Wood <i@gavwood.com> | 2014-07-01 06:16:01 +0800 |
---|---|---|
committer | Gav Wood <i@gavwood.com> | 2014-07-01 06:16:01 +0800 |
commit | 3174a5e0c6072004159326f000c0e1dfe6703b00 (patch) | |
tree | 34d20ebc891413a5b16d92ddfa2c7e2e19c99f39 /CodeFragment.h | |
parent | e65c3ff17de66cfd7d80ef78abba09c6ecf35ded (diff) | |
download | dexon-solidity-3174a5e0c6072004159326f000c0e1dfe6703b00.tar dexon-solidity-3174a5e0c6072004159326f000c0e1dfe6703b00.tar.gz dexon-solidity-3174a5e0c6072004159326f000c0e1dfe6703b00.tar.bz2 dexon-solidity-3174a5e0c6072004159326f000c0e1dfe6703b00.tar.lz dexon-solidity-3174a5e0c6072004159326f000c0e1dfe6703b00.tar.xz dexon-solidity-3174a5e0c6072004159326f000c0e1dfe6703b00.tar.zst dexon-solidity-3174a5e0c6072004159326f000c0e1dfe6703b00.zip |
Fixed problem with alloc.
Diffstat (limited to 'CodeFragment.h')
-rw-r--r-- | CodeFragment.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/CodeFragment.h b/CodeFragment.h index b9d44c03..58e40912 100644 --- a/CodeFragment.h +++ b/CodeFragment.h @@ -43,18 +43,21 @@ public: static CodeFragment compile(std::string const& _src, CompilerState& _s); /// Consolidates data and compiles code. - bytes code() const { return m_asm.assemble(); } + bytes code(CompilerState const& _cs); /// Consolidates data and compiles code. - std::string assembly() const { return m_asm.out(); } + std::string assembly(CompilerState const& _cs) { finalise(_cs); return m_asm.out(); } /// Optimise the code. Best do this just before calling code() or assembly(). void optimise() { m_asm.optimise(); } private: + void finalise(CompilerState const& _cs); + template <class T> void error() const { throw T(); } void constructOperation(sp::utree const& _t, CompilerState& _s); + bool m_finalised = false; Assembly m_asm; }; |