From bc64efe57af66d2980886fc116577e961fde0880 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Thu, 17 Jul 2025 19:23:31 +0800 Subject: [PATCH] ... --- include/pocketpy/interpreter/vm.h | 2 +- src/public/internal.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/pocketpy/interpreter/vm.h b/include/pocketpy/interpreter/vm.h index 816f760f..d216e612 100644 --- a/include/pocketpy/interpreter/vm.h +++ b/include/pocketpy/interpreter/vm.h @@ -67,7 +67,7 @@ typedef struct VM { NameDict compile_time_funcs; py_StackRef curr_class; - py_StackRef curr_decl_based_function; + py_StackRef curr_decl_based_function; // this is for get current function without frame TraceInfo trace_info; WatchdogInfo watchdog_info; LineProfiler line_profiler; diff --git a/src/public/internal.c b/src/public/internal.c index d7d740af..f291b3d5 100644 --- a/src/public/internal.c +++ b/src/public/internal.c @@ -231,6 +231,7 @@ bool pk_loadmethod(py_StackRef self, py_Name name) { if(ti->getunboundmethod) { bool ok = ti->getunboundmethod(self, name); + assert(py_retval()->type == tp_nativefunc || py_retval()->type == tp_function); if(ok) { self[0] = *py_retval(); self[1] = self_bak;