From 01fecaa3523b805d1cf4a1d5b10d6fc4a70e95fb Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sun, 15 Oct 2023 03:33:03 +0800 Subject: [PATCH] fix a bug --- include/pocketpy/frame.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/pocketpy/frame.h b/include/pocketpy/frame.h index 90f90112..647d039d 100644 --- a/include/pocketpy/frame.h +++ b/include/pocketpy/frame.h @@ -122,6 +122,8 @@ struct Frame { void _gc_mark() const { PK_OBJ_MARK(_module); co->_gc_mark(); + // Frame could be stored in a generator, so mark _callable for safety + if(_callable != nullptr) PK_OBJ_MARK(_callable); } };