aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-06-30 08:14:58 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-07-01 04:27:39 +0800
commit32d6c1c3168dc19ef818e5ff605af3a40f5601e8 (patch)
tree5a881d08846cc9e1f61c208effd10cc0a2fe35c4
parentb3be9d6fdc195519eccce22f07af5ee42af399ed (diff)
downloaddexon-solidity-32d6c1c3168dc19ef818e5ff605af3a40f5601e8.tar
dexon-solidity-32d6c1c3168dc19ef818e5ff605af3a40f5601e8.tar.gz
dexon-solidity-32d6c1c3168dc19ef818e5ff605af3a40f5601e8.tar.bz2
dexon-solidity-32d6c1c3168dc19ef818e5ff605af3a40f5601e8.tar.lz
dexon-solidity-32d6c1c3168dc19ef818e5ff605af3a40f5601e8.tar.xz
dexon-solidity-32d6c1c3168dc19ef818e5ff605af3a40f5601e8.tar.zst
dexon-solidity-32d6c1c3168dc19ef818e5ff605af3a40f5601e8.zip
MLOAD has side-effects, treat it like that in the optimiser
-rw-r--r--Changelog.md1
-rw-r--r--libevmasm/Instruction.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/Changelog.md b/Changelog.md
index 68f2272d..3aac912b 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -20,6 +20,7 @@ Features:
* Static Analyzer: Warn about deprecation of ``callcode``.
Bugfixes:
+ * Assembly: mark ``MLOAD`` to have side effects in the optimiser.
* Code generator: Use ``REVERT`` instead of ``INVALID`` for generated input validation routines.
* Type Checker: Fix address literals not being treated as compile-time constants.
* Type Checker: Disallow invoking the same modifier multiple times.
diff --git a/libevmasm/Instruction.cpp b/libevmasm/Instruction.cpp
index 8feb733a..b38981d2 100644
--- a/libevmasm/Instruction.cpp
+++ b/libevmasm/Instruction.cpp
@@ -216,7 +216,7 @@ static const std::map<Instruction, InstructionInfo> c_instructionInfo =
{ Instruction::DIFFICULTY, { "DIFFICULTY", 0, 0, 1, false, Tier::Base } },
{ Instruction::GASLIMIT, { "GASLIMIT", 0, 0, 1, false, Tier::Base } },
{ Instruction::POP, { "POP", 0, 1, 0, false, Tier::Base } },
- { Instruction::MLOAD, { "MLOAD", 0, 1, 1, false, Tier::VeryLow } },
+ { Instruction::MLOAD, { "MLOAD", 0, 1, 1, true, Tier::VeryLow } },
{ Instruction::MSTORE, { "MSTORE", 0, 2, 0, true, Tier::VeryLow } },
{ Instruction::MSTORE8, { "MSTORE8", 0, 2, 0, true, Tier::VeryLow } },
{ Instruction::SLOAD, { "SLOAD", 0, 1, 1, false, Tier::Special } },