YulRunner: Add support for memoryguard() and literal parameters

This commit is contained in:
Marenz 2022-07-19 18:48:56 +02:00
parent 1730e43bf7
commit 53b67334c5
2 changed files with 15 additions and 1 deletions

View File

@ -475,6 +475,8 @@ u256 EVMInstructionInterpreter::evalBuiltin(
);
return 0;
}
else if (fun == "memoryguard")
return _evaluatedArguments.at(0);
else
yulAssert(false, "Unknown builtin: " + fun);
return 0;

View File

@ -351,7 +351,19 @@ void ExpressionEvaluator::evaluateArgs(
if (!_literalArguments || !_literalArguments->at(_expr.size() - i - 1))
visit(expr);
else
m_values = {0};
{
string literal = std::get<Literal>(expr).value.str();
try
{
m_values = {u256(literal)};
}
catch (exception&)
{
m_values = {u256(0)};
}
}
values.push_back(value());
++i;
}