Commit d447561b authored by Paul's avatar Paul
Browse files

Check equality operator for instruction class

parent a9e098ac
......@@ -97,7 +97,8 @@ const std::vector<instruction_ref>& instruction::outputs() const { return output
bool operator==(const instruction& x, const instruction& y)
{
if(not(x.result == y.result and x.op == y.op and x.arguments == y.arguments))
static_assert(sizeof(instruction) == (sizeof(x.op) + sizeof(x.result) + sizeof(x.output) + sizeof(x.arguments) + sizeof(x.lit)), "Update equality operator");
if(std::tie(x.result, x.op, x.arguments) != std::tie(y.result, y.op, y.arguments))
return false;
if(x.name() == "@literal")
return x.lit == y.lit;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment