aboutsummaryrefslogtreecommitdiffstats
path: root/libevmasm
diff options
context:
space:
mode:
authorChristian Parpart <christian@ethereum.org>2018-12-12 21:51:22 +0800
committerChristian Parpart <christian@ethereum.org>2018-12-19 18:26:42 +0800
commit62fe57479e7d8949e4ed2e0efb31238d5d8d6d0a (patch)
treec2592dc9a8a1abae524717c0d081e51bf1ed3c24 /libevmasm
parentd10bae245ed441314c3bd6ecc74b2a1f3d060d12 (diff)
downloaddexon-solidity-62fe57479e7d8949e4ed2e0efb31238d5d8d6d0a.tar.gz
dexon-solidity-62fe57479e7d8949e4ed2e0efb31238d5d8d6d0a.tar.zst
dexon-solidity-62fe57479e7d8949e4ed2e0efb31238d5d8d6d0a.zip
make use of C++ `= default` constructor declarations as well as more non-static member initialization syntax.
Diffstat (limited to 'libevmasm')
-rw-r--r--libevmasm/Assembly.h2
-rw-r--r--libevmasm/KnownState.cpp4
-rw-r--r--libevmasm/KnownState.h17
3 files changed, 8 insertions, 15 deletions
diff --git a/libevmasm/Assembly.h b/libevmasm/Assembly.h
index d846b475..5dc6ef0e 100644
--- a/libevmasm/Assembly.h
+++ b/libevmasm/Assembly.h
@@ -45,8 +45,6 @@ using AssemblyPointer = std::shared_ptr<Assembly>;
class Assembly
{
public:
- Assembly() {}
-
AssemblyItem newTag() { assertThrow(m_usedTags < 0xffffffff, AssemblyException, ""); return AssemblyItem(Tag, m_usedTags++); }
AssemblyItem newPushTag() { assertThrow(m_usedTags < 0xffffffff, AssemblyException, ""); return AssemblyItem(PushTag, m_usedTags++); }
/// Returns a tag identified by the given name. Creates it if it does not yet exist.
diff --git a/libevmasm/KnownState.cpp b/libevmasm/KnownState.cpp
index a5546e61..d6cc5ddd 100644
--- a/libevmasm/KnownState.cpp
+++ b/libevmasm/KnownState.cpp
@@ -304,7 +304,7 @@ KnownState::StoreOperation KnownState::storeInStorage(
AssemblyItem item(Instruction::SSTORE, _location);
Id id = m_expressionClasses->find(item, {_slot, _value}, true, m_sequenceNumber);
- StoreOperation operation(StoreOperation::Storage, _slot, m_sequenceNumber, id);
+ StoreOperation operation{StoreOperation::Storage, _slot, m_sequenceNumber, id};
m_storageContent[_slot] = _value;
// increment a second time so that we get unique sequence numbers for writes
m_sequenceNumber++;
@@ -336,7 +336,7 @@ KnownState::StoreOperation KnownState::storeInMemory(Id _slot, Id _value, Source
AssemblyItem item(Instruction::MSTORE, _location);
Id id = m_expressionClasses->find(item, {_slot, _value}, true, m_sequenceNumber);
- StoreOperation operation(StoreOperation(StoreOperation::Memory, _slot, m_sequenceNumber, id));
+ StoreOperation operation{StoreOperation::Memory, _slot, m_sequenceNumber, id};
m_memoryContent[_slot] = _value;
// increment a second time so that we get unique sequence numbers for writes
m_sequenceNumber++;
diff --git a/libevmasm/KnownState.h b/libevmasm/KnownState.h
index 3ab1c4b1..3b5e9e7a 100644
--- a/libevmasm/KnownState.h
+++ b/libevmasm/KnownState.h
@@ -74,18 +74,13 @@ public:
struct StoreOperation
{
enum Target { Invalid, Memory, Storage };
- StoreOperation(): target(Invalid), sequenceNumber(-1) {}
- StoreOperation(
- Target _target,
- Id _slot,
- unsigned _sequenceNumber,
- Id _expression
- ): target(_target), slot(_slot), sequenceNumber(_sequenceNumber), expression(_expression) {}
+
bool isValid() const { return target != Invalid; }
- Target target;
- Id slot;
- unsigned sequenceNumber;
- Id expression;
+
+ Target target{Invalid};
+ Id slot{std::numeric_limits<Id>::max()};
+ unsigned sequenceNumber{std::numeric_limits<unsigned>::max()};
+ Id expression{std::numeric_limits<Id>::max()};
};
explicit KnownState(