From c5e8dfae128dfa9d72ffb4dd50392c3c4c87a1ed Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Fri, 25 Aug 2023 16:59:15 -0700 Subject: [PATCH] Workaround for free crash in LLVM. --- src/tcompiler.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tcompiler.cpp b/src/tcompiler.cpp index 35b5d601..6d9e0ad7 100644 --- a/src/tcompiler.cpp +++ b/src/tcompiler.cpp @@ -3679,7 +3679,10 @@ static int terra_deletefunction(lua_State *L) { VERBOSE_ONLY(CU->T) { printf("... uses not empty, removing body but keeping declaration.\n"); } +#if LLVM_VERSION < 150 + // FIXME: LLVM crashes if we attempt to delete with opaque pointers enabled func->deleteBody(); +#endif VERBOSE_ONLY(CU->T) { printf("... finish delete.\n"); } fstate->func = NULL; freecompilationunit(CU);