Commit a7c7593f authored by Marius Wachtler's avatar Marius Wachtler

GC: Attributes can have values that did not get allocated by the GC

Using the C API it's possible to create a Box instance without using our GC alloc.
For example have a look at md5module.c: PyDict_SetItemString(d, "MD5Type", (PyObject *)&MD5type);
parent 67e746b9
...@@ -183,7 +183,7 @@ extern "C" void boxGCHandler(GCVisitor* v, Box* b) { ...@@ -183,7 +183,7 @@ extern "C" void boxGCHandler(GCVisitor* v, Box* b) {
HCAttrs::AttrList* attr_list = attrs->attr_list; HCAttrs::AttrList* attr_list = attrs->attr_list;
assert(attr_list); assert(attr_list);
v->visit(attr_list); v->visit(attr_list);
v->visitRange((void**)&attr_list->attrs[0], (void**)&attr_list->attrs[nattrs]); v->visitPotentialRange((void**)&attr_list->attrs[0], (void**)&attr_list->attrs[nattrs]);
} }
} }
} else { } else {
......
# expected: fail
# - warnings about PyString_AsString(), since that is allowed to be modified
import hashlib import hashlib
#for m in [hashlib.md5(), hashlib.sha1(), hashlib.sha256(), hashlib.sha512()]: #for m in [hashlib.md5(), hashlib.sha1(), hashlib.sha256(), hashlib.sha512()]:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment