From 6098f57b03cae72668c6d2c1624a3a3f01d13fa9 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Sat, 15 Jun 2024 10:18:41 -0400 Subject: [PATCH] Attempt To Fix Rare Segfault --- src/method.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/method.ts b/src/method.ts index 4b64d61..8f03cf0 100644 --- a/src/method.ts +++ b/src/method.ts @@ -69,7 +69,7 @@ export class Method { const currentOverwriteName = '__current_overwrite_for_' + name; const thunkName = '__overwrite_thunk_for_' + name; if (code) { - out += `static ${functionType} ${currentOverwriteName};\n`; + out += `static ${functionType} &${currentOverwriteName} = *new ${functionType};\n`; out += `static ${formatType(this.returnType)}${thunkName}${this.args} {\n`; out += `${INDENT}${this.returnType.trim() === 'void' ? '' : 'return '}${currentOverwriteName}(${getArgNames(this.args).join(', ')});\n`; out += `}\n`;