Fix revert with reason coming from a string variable

This commit is contained in:
Alex Beregszaszi authored and chriseth committed 2018-05-09 17:53:17 +02:00
1 parent 868d449c38
commit c03a29dea8
4 files changed
+45 -2

No files matched your search

@@ -933,7 +933,11 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
// condition was not met, flag an error
m_context.appendInvalid();
else if (arguments.size() > 1)
{
utils().revertWithStringData(*arguments.at(1)->annotation().type);
// Here, the argument is consumed, but in the other branch, it is still there.
m_context.adjustStackOffset(arguments.at(1)->annotation().type->sizeOnStack());
}
else
m_context.appendRevert();
// the success branch