aboutsummaryrefslogtreecommitdiffstats
path: root/solidityCompiler.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-11-10 20:13:40 +0800
committerChristian <c@ethdev.com>2014-11-10 20:13:53 +0800
commit3a016ea0b41c67eeeabf7ae0d20ceb378f13f24a (patch)
tree30a0ce4543c73bffa565694a762b43a9c3be99ef /solidityCompiler.cpp
parent16007bd191a65ecbd0635244f87f9def09aa8036 (diff)
downloaddexon-solidity-3a016ea0b41c67eeeabf7ae0d20ceb378f13f24a.tar.gz
dexon-solidity-3a016ea0b41c67eeeabf7ae0d20ceb378f13f24a.tar.zst
dexon-solidity-3a016ea0b41c67eeeabf7ae0d20ceb378f13f24a.zip
Replace function selector jump table by more resilient linear time check.
Diffstat (limited to 'solidityCompiler.cpp')
-rw-r--r--solidityCompiler.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/solidityCompiler.cpp b/solidityCompiler.cpp
index ba2db67e..054ad329 100644
--- a/solidityCompiler.cpp
+++ b/solidityCompiler.cpp
@@ -80,7 +80,7 @@ BOOST_AUTO_TEST_CASE(smoke_test)
"}\n";
bytes code = compileContract(sourceCode);
- unsigned boilerplateSize = 51;
+ unsigned boilerplateSize = 42;
bytes expectation({byte(Instruction::JUMPDEST),
byte(Instruction::PUSH1), 0x0, // initialize local variable x
byte(Instruction::PUSH1), 0x2,
@@ -100,8 +100,8 @@ BOOST_AUTO_TEST_CASE(different_argument_numbers)
"}\n";
bytes code = compileContract(sourceCode);
- unsigned shift = 75;
- unsigned boilerplateSize = 88;
+ unsigned shift = 70;
+ unsigned boilerplateSize = 83;
bytes expectation({byte(Instruction::JUMPDEST),
byte(Instruction::PUSH1), 0x0, // initialize return variable d
byte(Instruction::DUP3),
@@ -153,8 +153,8 @@ BOOST_AUTO_TEST_CASE(ifStatement)
"}\n";
bytes code = compileContract(sourceCode);
- unsigned shift = 38;
- unsigned boilerplateSize = 51;
+ unsigned shift = 29;
+ unsigned boilerplateSize = 42;
bytes expectation({byte(Instruction::JUMPDEST),
byte(Instruction::PUSH1), 0x0,
byte(Instruction::DUP1),
@@ -195,8 +195,8 @@ BOOST_AUTO_TEST_CASE(loops)
"}\n";
bytes code = compileContract(sourceCode);
- unsigned shift = 38;
- unsigned boilerplateSize = 51;
+ unsigned shift = 29;
+ unsigned boilerplateSize = 42;
bytes expectation({byte(Instruction::JUMPDEST),
byte(Instruction::JUMPDEST),
byte(Instruction::PUSH1), 0x1,