Commit e285232
[3.13] pythongh-130851: Don't crash when deduping unusual code constants (pythonGH-130853) (python#130880)
The bytecode compiler only generates a few different types of constants,
like str, int, tuple, slices, etc. Users can construct code objects with
various unusual constants, including ones that are not hashable or not
even constant.
The free threaded build previously crashed with a fatal error when
confronted with these constants. Instead, treat distinct objects of
otherwise unhandled types as not equal for the purposes of deduplication.
(cherry picked from commit 2905690)
Co-authored-by: Sam Gross <[email protected]>1 parent 39f7b06 commit e285232
File tree
3 files changed
+32
-6
lines changed- Lib/test
- Misc/NEWS.d/next/Core_and_Builtins
- Objects
3 files changed
+32
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
596 | 596 | | |
597 | 597 | | |
598 | 598 | | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
599 | 616 | | |
600 | 617 | | |
601 | 618 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2527 | 2527 | | |
2528 | 2528 | | |
2529 | 2529 | | |
| 2530 | + | |
2530 | 2531 | | |
2531 | 2532 | | |
2532 | 2533 | | |
| |||
2548 | 2549 | | |
2549 | 2550 | | |
2550 | 2551 | | |
2551 | | - | |
| 2552 | + | |
| 2553 | + | |
2552 | 2554 | | |
2553 | 2555 | | |
2554 | 2556 | | |
| |||
2608 | 2610 | | |
2609 | 2611 | | |
2610 | 2612 | | |
2611 | | - | |
2612 | | - | |
| 2613 | + | |
| 2614 | + | |
2613 | 2615 | | |
2614 | 2616 | | |
2615 | 2617 | | |
| |||
2629 | 2631 | | |
2630 | 2632 | | |
2631 | 2633 | | |
2632 | | - | |
2633 | | - | |
2634 | | - | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
2635 | 2641 | | |
2636 | 2642 | | |
2637 | 2643 | | |
| |||
0 commit comments