| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
When --enable-unicode=ucs4, need to cast Py_UNICODE to a char
|
|
|
|
| |
Two of these were real bugs.
|
| |
|
|
|
|
|
|
|
| |
the range of ints. The old code would pass random truncated bits to
sq_repeat() on a 64-bit machine.
Backport candidate.
|
|
|
|
|
|
|
|
|
|
| |
but returns r->len which is a long. This doesn't even cause a warning
on 32-bit platforms, but can return bogus values on 64-bit platforms
(and should cause a compiler warning). Fix this by inserting a range
check when LONG_MAX != INT_MAX, and adding an explicit cast to (int)
when the test passes. When r->len is out of range, PySequence_Size()
and hence len() will report an error (but an iterator will still
work).
|
|
|
|
|
| |
This makes things a touch more like 2.2. Read the comments in
Python/ceval.c for more details.
|
| |
|
| |
|
|
|
|
| |
out of the loop.
|
|
|
|
| |
out of the loop.
|
|
|
|
|
|
|
|
|
|
| |
Unicode strings (with arbitrary length) are allowed
as entries in the unicode.translate mapping.
Add a test case for multicharacter replacements.
(Multicharacter replacements were enabled by the
PEP 293 patch)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
globals, _Py_Ticker and _Py_CheckInterval. This also implements Jeremy's
shortcut in Py_AddPendingCall that zeroes out _Py_Ticker. This allows the
test in the main loop to only test a single value.
The gory details are at
http://python.org/sf/602191
|
|
|
|
|
|
|
|
|
| |
of PyString_DecodeEscape(). This prevents a call to
_PyString_Resize() for the empty string, which would
result in a PyErr_BadInternalCall(), because the
empty string has more than one reference.
This closes SF bug http://www.python.org/sf/603937
|
| |
|
|
|
|
|
| |
Now all non-mutating dict methods are in the proxy also.
Inspired by SF bug #602232,
|
| |
|
|
|
|
| |
when given its own type as an argument.
|
|
|
|
|
|
| |
possible. This always called PyUnicode_Check() and PyString_Check(),
at least one of which would call PyType_IsSubtype(). Also, this would
call PyString_Size() on known string objects.
|
|
|
|
|
| |
Because all built-in tests return bools now, this is the most common
path!
|
|
|
|
|
| |
always returns a bool, so avoid calling PyObject_IsTrue() in that
case.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
wrong thing for a unicode subclass when there were zero string
replacements. The example given in the SF bug report was only one way
to trigger this; replacing a string of length >= 2 that's not found is
another. The code would actually write outside allocated memory if
replacement string was longer than the search string.
(I wonder how many more of these are lurking? The unicode code base
is full of wonders.)
Bugfix candidate; this same bug is present in 2.2.1.
|
|
|
|
|
| |
the string/unicode method .replace() with a zero-lengt first argument.
Inyeol contributed tests for this too.
|
|
|
|
|
|
|
|
|
|
|
|
| |
SHIFT and MASK, and widen digit. One problem is that code of the form
digit << small_integer
implicitly assumes that the result fits in an int or unsigned int
(platform-dependent, but "int sized" in any case), since digit is
promoted "just" to int or unsigned via the usual integer promotions.
But if digit is typedef'ed as unsigned int, this loses information.
The cure for this is just to cast digit to twodigits first.
|
|
|
|
|
|
| |
These were reported and fixed by Inyeol Lee in SF bug 595350. The
endswith() bug was already fixed in 2.3, but this adds some more test
cases.
|
|
|
|
| |
signed vs unsigned).
|
|
|
|
|
|
|
|
| |
interning. I modified Oren's patch significantly, but the basic idea
and most of the implementation is unchanged. Interned strings created
with PyString_InternInPlace() are now mortal, and you must keep a
reference to the resulting string around; use the new function
PyString_InternImmortal() to create immortal interned strings.
|
|
|
|
|
|
|
| |
comments everywhere that bugged me: /* Foo is inlined */ instead of
/* Inline Foo */. Somehow the "is inlined" phrase always confused me
for half a second (thinking, "No it isn't" until I added the missing
"here"). The new phrase is hopefully unambiguous.
|
|
|
|
| |
to _PyType_Lookup().
|
|
|
|
| |
Should save 4% on slot lookups.
|
|
|
|
|
|
| |
Move some debugging checks inside Py_DEBUG.
They were causing cache misses according to cachegrind.
|
|
|
|
| |
This causes a modest speedup.
|
|
|
|
|
|
|
| |
expensive and overly general PyObject_IsInstance(), call
PyObject_TypeCheck() which is a macro that often avoids a call, and if
it does make a call, calls the much more efficient PyType_IsSubtype().
This saved 6% on a benchmark for slot lookups.
|
|
|
|
| |
com_error() is static in Python/compile.c.
|
|
|
|
|
|
|
| |
-- replace then with slightly faster PyObject_Call(o,a,NULL). (The
difference is that the latter requires a to be a tuple; the former
allows other values and wraps them in a tuple if necessary; it
involves two more levels of C function calls to accomplish all that.)
|
|
|
|
| |
to inner scope, too.
|
| |
|
|
|
|
|
|
|
| |
rigorous instead of hoping for testing not to turn up counterexamples.
Call me heretical, but despite that I'm wholly confident in the proof,
and have done it two different ways now, I still put more faith in
testing ...
|
|
|
|
|
| |
normalized result, so no point to normalizing it again. The number
of test+branches was also excessive.
|
|
|
|
|
|
|
|
| |
[ 587993 ] SET_LINENO killer
Remove SET_LINENO. Tracing is now supported by inspecting co_lnotab.
Many sundry changes to document and adapt to this change.
|
| |
|
| |
|
|
|
|
| |
copy the metatype from the base, the base actually has one!
|
|
|
|
| |
al*bl "always fit": it's actually trivial given what came before.
|
|
|
|
|
|
| |
ah*bh and al*bl. This is much easier than explaining why that's true
for (ah+al)*(bh+bl), and follows directly from the simple part of the
(ah+al)*(bh+bl) explanation.
|
| |
|
| |
|
| |
|
| |
|