aboutsummaryrefslogtreecommitdiffstats
path: root/libevmasm/SemanticInformation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libevmasm/SemanticInformation.cpp')
-rw-r--r--libevmasm/SemanticInformation.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/libevmasm/SemanticInformation.cpp b/libevmasm/SemanticInformation.cpp
index 03870f7c..71267ee8 100644
--- a/libevmasm/SemanticInformation.cpp
+++ b/libevmasm/SemanticInformation.cpp
@@ -28,7 +28,7 @@ using namespace std;
using namespace dev;
using namespace dev::eth;
-bool SemanticInformation::breaksCSEAnalysisBlock(AssemblyItem const& _item)
+bool SemanticInformation::breaksCSEAnalysisBlock(AssemblyItem const& _item, bool _msizeImportant)
{
switch (_item.type())
{
@@ -59,6 +59,11 @@ bool SemanticInformation::breaksCSEAnalysisBlock(AssemblyItem const& _item)
return false;
if (_item.instruction() == Instruction::MSTORE)
return false;
+ if (!_msizeImportant && (
+ _item.instruction() == Instruction::MLOAD ||
+ _item.instruction() == Instruction::KECCAK256
+ ))
+ return false;
//@todo: We do not handle the following memory instructions for now:
// calldatacopy, codecopy, extcodecopy, mstore8,
// msize (note that msize also depends on memory read access)