From c41f3649ee33a6488638845c8cd5a742cfe4d2ee Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Thu, 29 Jun 2023 21:03:13 +0800 Subject: [PATCH] ... --- src/vm.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vm.h b/src/vm.h index f5140cc9..17c22303 100644 --- a/src/vm.h +++ b/src/vm.h @@ -1561,7 +1561,9 @@ inline PyObject* VM::bind(PyObject* obj, const char* sig, const char* docstring, throw std::runtime_error("expected 1 function declaration"); } FuncDecl_ decl = co->func_decls[0]; - return VAR(NativeFunc(fn, decl, docstring)); + PyObject* f_obj = VAR(NativeFunc(fn, decl, docstring)); + obj->attr().set(decl->code->name, f_obj); + return f_obj; } inline void VM::_error(Exception e){