Commit 51b4ade
committed
Fix obscure breakage (relative to 2.3) in listsort: the test for list
mutation during list.sort() used to rely on that listobject.c always
NULL'ed ob_item when ob_size fell to 0. That's no longer true, so the
test for list mutation during a sort is no longer reliable. Changed the
test to rely instead on that listobject.c now never NULLs-out ob_item
after (if ever) ob_item gets a non-NULL value. This new assumption is
also documented now, as a required invariant in listobject.h.
The new assumption allowed some real simplification to some of the
hairier code in listsort(), so is a Good Thing on that count.1 parent 014f103 commit 51b4ade
2 files changed
Lines changed: 15 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1906 | 1906 | | |
1907 | 1907 | | |
1908 | 1908 | | |
1909 | | - | |
1910 | 1909 | | |
1911 | 1910 | | |
1912 | 1911 | | |
| |||
1941 | 1940 | | |
1942 | 1941 | | |
1943 | 1942 | | |
1944 | | - | |
1945 | | - | |
1946 | | - | |
| 1943 | + | |
| 1944 | + | |
1947 | 1945 | | |
1948 | 1946 | | |
1949 | 1947 | | |
| |||
1957 | 1955 | | |
1958 | 1956 | | |
1959 | 1957 | | |
1960 | | - | |
1961 | | - | |
1962 | | - | |
1963 | | - | |
1964 | | - | |
1965 | | - | |
1966 | | - | |
1967 | | - | |
1968 | | - | |
1969 | | - | |
1970 | | - | |
1971 | | - | |
1972 | 1958 | | |
1973 | 1959 | | |
1974 | 1960 | | |
| |||
2044 | 2030 | | |
2045 | 2031 | | |
2046 | 2032 | | |
2047 | | - | |
2048 | | - | |
2049 | | - | |
2050 | | - | |
2051 | | - | |
2052 | | - | |
2053 | | - | |
2054 | | - | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
2055 | 2039 | | |
2056 | 2040 | | |
2057 | 2041 | | |
| |||
2060 | 2044 | | |
2061 | 2045 | | |
2062 | 2046 | | |
2063 | | - | |
2064 | | - | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
2065 | 2051 | | |
2066 | 2052 | | |
2067 | 2053 | | |
| |||
0 commit comments