mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-33803: Fix a crash in hamt.c (#7504)
This commit is contained in:
parent
c4f3cb772b
commit
378c53cc31
2 changed files with 4 additions and 0 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
Fix a crash in hamt.c caused by enabling GC tracking for an object that
|
||||||
|
hadn't all of its fields set to NULL.
|
|
@ -2476,6 +2476,8 @@ hamt_alloc(void)
|
||||||
if (o == NULL) {
|
if (o == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
o->h_count = 0;
|
||||||
|
o->h_root = NULL;
|
||||||
o->h_weakreflist = NULL;
|
o->h_weakreflist = NULL;
|
||||||
PyObject_GC_Track(o);
|
PyObject_GC_Track(o);
|
||||||
return o;
|
return o;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue