Merge pull request #5888 from ethereum/betterStackErrorMessages

Better error message for out of stack in assembly.
This commit is contained in:
chriseth
2019-02-04 15:26:55 +01:00
committed by GitHub
4 changed files with 55 additions and 26 deletions
+21 -10
View File
@@ -184,14 +184,25 @@ void CodeGenerator::assemble(
)
{
EthAssemblyAdapter assemblyAdapter(_assembly);
CodeTransform(
assemblyAdapter,
_analysisInfo,
_parsedData,
*EVMDialect::strictAssemblyForEVM(),
_optimize,
false,
_identifierAccess,
_useNamedLabelsForFunctions
)(_parsedData);
try
{
CodeTransform(
assemblyAdapter,
_analysisInfo,
_parsedData,
*EVMDialect::strictAssemblyForEVM(),
_optimize,
false,
_identifierAccess,
_useNamedLabelsForFunctions
)(_parsedData);
}
catch (StackTooDeepError const& _e)
{
BOOST_THROW_EXCEPTION(
InternalCompilerError() << errinfo_comment(
"Stack too deep when compiling inline assembly" +
(_e.comment() ? ": " + *_e.comment() : ".")
));
}
}