Compare commits

...

3 Commits

Author SHA1 Message Date
blueloveTH
7d85da5ad3 Update internal.c 2025-07-17 19:56:28 +08:00
blueloveTH
bc64efe57a ... 2025-07-17 19:23:31 +08:00
blueloveTH
f1d4ef5e1c Update pocketpy.h 2025-07-17 17:37:37 +08:00
3 changed files with 3 additions and 2 deletions

View File

@ -67,7 +67,7 @@ typedef struct VM {
NameDict compile_time_funcs; NameDict compile_time_funcs;
py_StackRef curr_class; 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; TraceInfo trace_info;
WatchdogInfo watchdog_info; WatchdogInfo watchdog_info;
LineProfiler line_profiler; LineProfiler line_profiler;

View File

@ -300,7 +300,7 @@ PK_API void* py_newobject(py_OutRef out, py_Type type, int slots, int udsize);
/// Convert an `int` object in python to `int64_t`. /// Convert an `int` object in python to `int64_t`.
PK_API py_i64 py_toint(py_Ref); PK_API py_i64 py_toint(py_Ref);
/// Convert a trivial value object in python to `int64_t`. /// Get the address of the trivial value object.
PK_API void* py_totrivial(py_Ref); PK_API void* py_totrivial(py_Ref);
/// Convert a `float` object in python to `double`. /// Convert a `float` object in python to `double`.
PK_API py_f64 py_tofloat(py_Ref); PK_API py_f64 py_tofloat(py_Ref);

View File

@ -232,6 +232,7 @@ bool pk_loadmethod(py_StackRef self, py_Name name) {
if(ti->getunboundmethod) { if(ti->getunboundmethod) {
bool ok = ti->getunboundmethod(self, name); bool ok = ti->getunboundmethod(self, name);
if(ok) { if(ok) {
assert(py_retval()->type == tp_nativefunc || py_retval()->type == tp_function);
self[0] = *py_retval(); self[0] = *py_retval();
self[1] = self_bak; self[1] = self_bak;
return true; return true;