Commit b1d8302
Fix int_mul SmallInt overflow clobber + get_iterator exception loss
Two critical crash fixes:
1. int_mul: `mov rcx, rsi` clobbered ecx (right_tag) before the
overflow path could use it. When SmallInt multiply overflowed
(e.g. sys.maxsize * 2), the GMP conversion path used the
clobbered tag, treating a SmallInt value as a heap pointer.
Fix: save/restore ecx around the multiply.
2. get_iterator: when dunder_call_1 for __iter__ raised an exception
(e.g. KeyboardInterrupt), get_iterator silently dropped it and
fell through to __getitem__ fallback, corrupting state for
subsequent operations.
Fix: check current_exception after dunder_call_1 failure,
propagate via eval_exception_unwind.
Real CPython test_list.py: 30/52 pass (was 20, no more crashes).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 909c33a commit b1d8302
2 files changed
Lines changed: 22 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
156 | 162 | | |
157 | 163 | | |
158 | 164 | | |
| |||
223 | 229 | | |
224 | 230 | | |
225 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
226 | 243 | | |
227 | 244 | | |
228 | 245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1206 | 1206 | | |
1207 | 1207 | | |
1208 | 1208 | | |
| 1209 | + | |
1209 | 1210 | | |
1210 | 1211 | | |
1211 | | - | |
| 1212 | + | |
| 1213 | + | |
1212 | 1214 | | |
1213 | 1215 | | |
1214 | 1216 | | |
| 1217 | + | |
| 1218 | + | |
1215 | 1219 | | |
1216 | 1220 | | |
1217 | 1221 | | |
| |||
0 commit comments