aboutsummaryrefslogtreecommitdiffstats
path: root/SemanticInformation.h
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-04-30 21:31:16 +0800
committerchriseth <c@ethdev.com>2015-05-06 17:11:16 +0800
commita2e3bcbd0c45a79a9709dc8a69858765ab904805 (patch)
tree1201a25150145a991ef11c5f62465986c6b27dea /SemanticInformation.h
parent867101e40981db56d8b72fd363e4f9e376991284 (diff)
downloaddexon-solidity-a2e3bcbd0c45a79a9709dc8a69858765ab904805.tar
dexon-solidity-a2e3bcbd0c45a79a9709dc8a69858765ab904805.tar.gz
dexon-solidity-a2e3bcbd0c45a79a9709dc8a69858765ab904805.tar.bz2
dexon-solidity-a2e3bcbd0c45a79a9709dc8a69858765ab904805.tar.lz
dexon-solidity-a2e3bcbd0c45a79a9709dc8a69858765ab904805.tar.xz
dexon-solidity-a2e3bcbd0c45a79a9709dc8a69858765ab904805.tar.zst
dexon-solidity-a2e3bcbd0c45a79a9709dc8a69858765ab904805.zip
Make KnownState work with all instructions.
Diffstat (limited to 'SemanticInformation.h')
-rw-r--r--SemanticInformation.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/SemanticInformation.h b/SemanticInformation.h
index 27aa6f1a..b14ddb65 100644
--- a/SemanticInformation.h
+++ b/SemanticInformation.h
@@ -23,6 +23,7 @@
#pragma once
+#include <libevmcore/Instruction.h>
namespace dev
{
@@ -45,6 +46,14 @@ struct SemanticInformation
static bool isSwapInstruction(AssemblyItem const& _item);
static bool isJumpInstruction(AssemblyItem const& _item);
static bool altersControlFlow(AssemblyItem const& _item);
+ /// @returns false if the value put on the stack by _item depends on anything else than
+ /// the information in the current block header, memory, storage or stack.
+ /// @note should not be called for instructions that alter the control flow.
+ static bool isDeterministic(AssemblyItem const& _item);
+ /// @returns true if the given instruction modifies memory.
+ static bool invalidatesMemory(Instruction _instruction);
+ /// @returns true if the given instruction modifies storage (even indirectly).
+ static bool invalidatesStorage(Instruction _instruction);
};
}