# HG changeset patch
# User Nils Bruin <nbruin@sfu.ca>
# Date 1357065238 28800
# Node ID 0d726dbd96be2f18b2296c76e82decca2491d19c
# Parent faa22a1850b281c1b7f978dd2a9bbee8798288a6
[mq]: double-free-crash.patch
diff --git a/sage/structure/coerce_dict.pyx b/sage/structure/coerce_dict.pyx
a
|
b
|
|
33 | 33 | include "../ext/python_list.pxi" |
34 | 34 | |
35 | 35 | from weakref import KeyedRef |
| 36 | from gc import collect |
36 | 37 | |
37 | 38 | ############################################ |
38 | 39 | # The following code is responsible for |
… |
… |
|
116 | 117 | # stored key of the unique triple r() had been part of. |
117 | 118 | # We remove that unique triple from self.D |
118 | 119 | cdef size_t k1,k2,k3 |
| 120 | collect() |
119 | 121 | k1,k2,k3 = r.key |
120 | 122 | cdef size_t h = (k1 + 13*k2 ^ 503*k3) |
121 | 123 | cdef list bucket = <object>PyList_GET_ITEM(self.D.buckets, h % PyList_GET_SIZE(self.D.buckets)) |