From 45e62a2bc1c0000e2e9b613fff6bebf2c26fcb93 Mon Sep 17 00:00:00 2001 From: Mark Shannon Date: Mon, 20 Jun 2022 12:59:25 +0100 Subject: GH-93897: Store frame size in code object and de-opt if insufficient space on thread frame stack. (GH-93908) --- Tools/scripts/deepfreeze.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Tools/scripts') diff --git a/Tools/scripts/deepfreeze.py b/Tools/scripts/deepfreeze.py index 443fcf2274..de8fde448e 100644 --- a/Tools/scripts/deepfreeze.py +++ b/Tools/scripts/deepfreeze.py @@ -118,6 +118,7 @@ class Printer: self.write('#include "Python.h"') self.write('#include "internal/pycore_gc.h"') self.write('#include "internal/pycore_code.h"') + self.write('#include "internal/pycore_frame.h"') self.write('#include "internal/pycore_long.h"') self.write("") @@ -256,6 +257,7 @@ class Printer: self.field(code, "co_argcount") self.field(code, "co_posonlyargcount") self.field(code, "co_kwonlyargcount") + self.write(f".co_framesize = {code.co_stacksize + len(localsplusnames)} + FRAME_SPECIALS_SIZE,") self.field(code, "co_stacksize") self.field(code, "co_firstlineno") self.write(f".co_nlocalsplus = {len(localsplusnames)},") -- cgit v1.2.1