File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -118,12 +118,20 @@ cdef int move_gens_to_heap(pari_sp lim) except -1:
118
118
avma <= lim.
119
119
"""
120
120
while avma <= lim and stackbottom is not < PyObject* > top_of_stack:
121
- sig_on()
122
121
current = < Gen> stackbottom
123
- h = gclone(current.g)
122
+ sig_on()
123
+ current.g = gclone(current.g)
124
124
sig_off()
125
125
remove_from_pari_stack(current)
126
- current.g = current.address = h
126
+ # The .address attribute can only be updated now because it is
127
+ # needed in remove_from_pari_stack(). This means that the object
128
+ # is temporarily in an inconsistent state but this does not
129
+ # matter since .address is normally not used.
130
+ #
131
+ # The more important .g attribute is updated correctly before
132
+ # remove_from_pari_stack(). Therefore, the object can be used
133
+ # normally regardless of what happens to the PARI stack.
134
+ current.address = current.g
127
135
128
136
129
137
cdef Gen new_gen(GEN x):
You can’t perform that action at this time.
0 commit comments