Commit 5c3dd1c
committed
gh-130851: Only intern constants of types generated by compiler
The free threading build interns and immortalizes most constants
generated by the bytecode compiler. However, users can construct their
own code objects with arbitrary constants. Don't intern or immortalize
these objects if they are not a type that we know how to handle.
This fixes a refleak failure in the recently added
`test_code.test_unusual_constants` test.
It also fixes a potential crash that could happen when we try to
destory a immortalized object on interpreter shutdown.1 parent 02de9cb commit 5c3dd1c
1 file changed
+40
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
138 | 175 | | |
139 | 176 | | |
140 | 177 | | |
| |||
241 | 278 | | |
242 | 279 | | |
243 | 280 | | |
244 | | - | |
245 | | - | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
246 | 284 | | |
247 | 285 | | |
248 | 286 | | |
| |||
0 commit comments