Skip to content

Commit 71d8fe3

Browse files
committed
Patch codegen ICE due to unneeded variable for functions that return no parameters
1 parent 675b4d0 commit 71d8fe3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,10 @@ 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+
solAssert(!functionDefinition->returnParameterList());
327+
if (functionDefinition->experimentalReturnExpression())
328+
m_code << "let " << IRNames::localVariable(_functionCall) << " := ";
329+
m_code << IRNames::function(*m_context.env, *functionDefinition, functionType) << "(";
327330
auto const& arguments = _functionCall.arguments();
328331
if (arguments.size() > 1)
329332
for (auto arg: arguments | ranges::views::drop_last(1))

0 commit comments

Comments
 (0)