From 92c3eb8021184d2b677c6b2e303fd9949c3a4b1b Mon Sep 17 00:00:00 2001 From: Gabriel Baraldi Date: Thu, 21 Mar 2024 20:32:17 -0400 Subject: [PATCH] Add missing GC_POP() in emit_cfunction (#53809) ~~Apparently somewhere in codegen inside `emit_codeinst`some piece of code is relying on the implicit try catch gcstack restoring. I haven't got the analyzer working on that file yet (it has hundreds of issues and it doesn't like C++ code that much + the file is tens of thousands of lines after includes so it struggles).~~ This fixes the compileall segfault in apple-aarch64 ci. https://github.com/JuliaLang/julia/issues/53811 (cherry picked from commit 52fc79696e0b08fe1793a001daaefd1d91d59f0c) --- src/codegen.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/codegen.cpp b/src/codegen.cpp index f1e89e760aa1c..dd3376c334a37 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -6679,6 +6679,7 @@ static jl_cgval_t emit_cfunction(jl_codectx_t &ctx, jl_value_t *output_type, con if (ctx.emission_context.TargetTriple.isAArch64() || ctx.emission_context.TargetTriple.isARM() || ctx.emission_context.TargetTriple.isPPC64()) { if (nest) { emit_error(ctx, "cfunction: closures are not supported on this platform"); + JL_GC_POP(); return jl_cgval_t(); } }