mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-19 19:10:17 +00:00
fix a bug
This commit is contained in:
parent
86b4fc623c
commit
8277895502
@ -603,8 +603,19 @@ static void mark_object(PyObject* obj) {
|
||||
}
|
||||
|
||||
void CodeObject__gc_mark(const CodeObject* self) {
|
||||
c11__foreach(py_TValue, &self->consts, i) { pk__mark_value(i); }
|
||||
c11__foreach(FuncDecl_, &self->func_decls, i) { CodeObject__gc_mark(&(*i)->code); }
|
||||
for(int i = 0; i < self->consts.length; i++) {
|
||||
py_TValue* p = c11__at(py_TValue, &self->consts, i);
|
||||
pk__mark_value(p);
|
||||
}
|
||||
for(int i = 0; i < self->func_decls.length; i++) {
|
||||
FuncDecl_ decl = c11__getitem(FuncDecl_, &self->func_decls, i);
|
||||
CodeObject__gc_mark(&decl->code);
|
||||
|
||||
for(int j = 0; j < decl->kwargs.length; j++) {
|
||||
FuncDeclKwArg* kw = c11__at(FuncDeclKwArg, &decl->kwargs, j);
|
||||
pk__mark_value(&kw->value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ManagedHeap__mark(ManagedHeap* self) {
|
||||
|
@ -278,6 +278,7 @@ static bool builtins_round(int argc, py_Ref argv) {
|
||||
}
|
||||
|
||||
static bool builtins_print(int argc, py_Ref argv) {
|
||||
// print(*args, sep=' ', end='\n')
|
||||
py_TValue* args;
|
||||
int length = pk_arrayview(argv, &args);
|
||||
assert(length != -1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user