mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-19 19:10:17 +00:00
backup
This commit is contained in:
parent
a55f62c860
commit
0ce88fa70c
@ -4,6 +4,7 @@
|
||||
#include "pocketpy/interpreter/vm.h"
|
||||
#include "pocketpy/common/sstream.h"
|
||||
#include "pocketpy/objects/codeobject.h"
|
||||
#include "pocketpy/objects/exception.h"
|
||||
#include "pocketpy/pocketpy.h"
|
||||
#include "pocketpy/objects/error.h"
|
||||
#include <stdbool.h>
|
||||
@ -820,7 +821,8 @@ __NEXT_STEP:
|
||||
return RES_YIELD;
|
||||
} else {
|
||||
assert(self->last_retval.type == tp_StopIteration);
|
||||
py_ObjectRef value = py_getslot(&self->last_retval, 0);
|
||||
BaseException* ud = py_touserdata(py_retval());
|
||||
py_ObjectRef value = &ud->args;
|
||||
if(py_isnil(value)) value = py_None();
|
||||
*TOP() = *value; // [iter] -> [retval]
|
||||
DISPATCH_JUMP((int16_t)byte.arg);
|
||||
|
@ -635,7 +635,9 @@ void ManagedHeap__mark(ManagedHeap* self) {
|
||||
assert(p_stack->length == 0);
|
||||
|
||||
// mark value stack
|
||||
for(py_TValue* p = vm->stack.begin; p != vm->stack.end; p++) {
|
||||
for(py_TValue* p = vm->stack.begin; p < vm->stack.sp; p++) {
|
||||
// assert(p->type != tp_nil);
|
||||
if(py_isnil(p)) continue;
|
||||
pk__mark_value(p);
|
||||
}
|
||||
// mark modules
|
||||
|
9
tests/71_gc_bug.py
Normal file
9
tests/71_gc_bug.py
Normal file
@ -0,0 +1,9 @@
|
||||
a=[]
|
||||
import gc
|
||||
gc.collect()
|
||||
|
||||
# a.append(a)
|
||||
print(list(globals().items()))
|
||||
del a
|
||||
print(list(globals().items()))
|
||||
gc.collect()
|
Loading…
x
Reference in New Issue
Block a user