mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Check availability of data objects already in analysis phase.
This commit is contained in:
+13
-5
@@ -383,11 +383,19 @@ bool AsmAnalyzer::operator()(FunctionCall const& _funCall)
|
||||
{
|
||||
if (!expectExpression(arg))
|
||||
success = false;
|
||||
else if (needsLiteralArguments && arg.type() != typeid(Literal))
|
||||
m_errorReporter.typeError(
|
||||
_funCall.functionName.location,
|
||||
"Function expects direct literals as arguments."
|
||||
);
|
||||
else if (needsLiteralArguments)
|
||||
{
|
||||
if (arg.type() != typeid(Literal))
|
||||
m_errorReporter.typeError(
|
||||
_funCall.functionName.location,
|
||||
"Function expects direct literals as arguments."
|
||||
);
|
||||
else if (!m_dataNames.count(boost::get<Literal>(arg).value))
|
||||
m_errorReporter.typeError(
|
||||
_funCall.functionName.location,
|
||||
"Unknown data object \"" + boost::get<Literal>(arg).value.str() + "\"."
|
||||
);
|
||||
}
|
||||
}
|
||||
// Use argument size instead of parameter count to avoid misleading errors.
|
||||
m_stackHeight += int(returns) - int(_funCall.arguments.size());
|
||||
|
||||
Reference in New Issue
Block a user