Skip to content

Commit d0bae61

Browse files
authored
Merge pull request #16026 from ethereum/assert_swapn_dupn_in_assemblyitem
AssemblyItem asserts that it's not implicity constructed by instruction for swapn/dupn
2 parents d77affb + 78107e3 commit d0bae61

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libevmasm/AssemblyItem.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ class AssemblyItem
8585
m_type(Operation),
8686
m_instruction(_i),
8787
m_debugData(std::move(_debugData))
88-
{}
88+
{
89+
solAssert(_i != Instruction::SWAPN, "Construct via AssemblyItem::swapN");
90+
solAssert(_i != Instruction::DUPN, "Construct via AssemblyItem::dupN");
91+
}
8992
AssemblyItem(AssemblyItemType _type, u256 _data = 0, langutil::DebugData::ConstPtr _debugData = langutil::DebugData::create()):
9093
m_type(_type),
9194
m_debugData(std::move(_debugData))

0 commit comments

Comments
 (0)