Skip to content

Commit e78811e

Browse files
committed
Patch codegen ICE due to unneeded variable for functions that return no parameters
1 parent 4a2c28b commit e78811e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: libsolidity/experimental/codegen/IRGeneratorForStatements.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,9 @@ void IRGeneratorForStatements::endVisit(FunctionCall const& _functionCall)
323323
functionType = m_context.env->resolveRecursive(functionType);
324324
m_context.enqueueFunctionDefinition(functionDefinition, functionType);
325325
// TODO: account for return stack size
326-
m_code << "let " << IRNames::localVariable(_functionCall) << " := " << IRNames::function(*m_context.env, *functionDefinition, functionType) << "(";
326+
if (functionDefinition->returnParameterList() && !functionDefinition->returnParameterList()->parameters().empty())
327+
m_code << "let " << IRNames::localVariable(_functionCall) << " := ";
328+
m_code << IRNames::function(*m_context.env, *functionDefinition, functionType) << "(";
327329
auto const& arguments = _functionCall.arguments();
328330
if (arguments.size() > 1)
329331
for (auto arg: arguments | ranges::views::drop_last(1))

0 commit comments

Comments
 (0)