From 272136e7fc79f6e9d12ec1489aa0e39912f1fc78 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Tue, 2 Dec 2025 19:39:20 +0100 Subject: [PATCH] Fix local variable allocations for functions with prototypes --- src/mlir/cxx/mlir/codegen_declarations.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mlir/cxx/mlir/codegen_declarations.cc b/src/mlir/cxx/mlir/codegen_declarations.cc index 42c69795..b092ba63 100644 --- a/src/mlir/cxx/mlir/codegen_declarations.cc +++ b/src/mlir/cxx/mlir/codegen_declarations.cc @@ -160,6 +160,10 @@ void Codegen::DeclarationVisitor::allocateLocals(ScopeSymbol* block) { allocateLocals(nestedBlock); continue; } + if (auto params = symbol_cast(symbol)) { + allocateLocals(params); + continue; + } if (auto var = symbol_cast(symbol)) { if (var->isStatic()) continue; @@ -730,4 +734,4 @@ void Codegen::asmQualifier(AsmQualifierAST* ast) {} void Codegen::asmClobber(AsmClobberAST* ast) {} void Codegen::asmGotoLabel(AsmGotoLabelAST* ast) {} -} // namespace cxx \ No newline at end of file +} // namespace cxx