blueloveTH hai 7 meses
pai
achega
054fcba7e4
Modificáronse 2 ficheiros con 8 adicións e 5 borrados
  1. 4 1
      src/public/values.c
  2. 4 4
      tests/71_gc_bug.py

+ 4 - 1
src/public/values.c

@@ -47,7 +47,10 @@ void py_newellipsis(py_OutRef out) {
     out->is_ptr = false;
     out->is_ptr = false;
 }
 }
 
 
-void py_newnil(py_OutRef out) { out->type = 0; }
+void py_newnil(py_OutRef out) {
+    out->type = tp_nil;
+    out->is_ptr = false;
+}
 
 
 void py_newnativefunc(py_OutRef out, py_CFunction f) {
 void py_newnativefunc(py_OutRef out, py_CFunction f) {
     out->type = tp_nativefunc;
     out->type = tp_nativefunc;

+ 4 - 4
tests/71_gc_bug.py

@@ -40,7 +40,7 @@ a = []
 del a
 del a
 assert gc.collect() == 1
 assert gc.collect() == 1
 
 
-# a = []
-# a.append(a)
-# del a
-# assert gc.collect() == 1
+a = []
+a.append(a)
+del a
+assert gc.collect() == 1