Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Replace outdated optimization with clearer code that compiles better. | Raymond Hettinger | 2013-08-06 | 1 | -3/+3 |
| | | | | | | | | | | | | | | | | | | | | | Letting the compiler decide how to optimize the multiply by five gives it the freedom to make better choices for the best technique for a given target machine. For example, GCC on x86_64 produces a little bit better code: Old-way (3 steps with a data dependency between each step): shrq $5, %r13 leaq 1(%rbx,%r13), %rax leaq (%rax,%rbx,4), %rbx New-way (3 steps with no dependency between the first two steps which can be run in parallel): leaq (%rbx,%rbx,4), %rax # i*5 shrq $5, %r13 # perturb >>= PERTURB_SHIFT leaq 1(%r13,%rax), %rbx # 1 + perturb + i*5 | ||||
* | Issue #17934: Add a clear() method to frame objects, to help clean up ↵ | Antoine Pitrou | 2013-08-05 | 2 | -5/+31 |
| | | | | expensive details (local variables) and break reference cycles. | ||||
* | merge | Raymond Hettinger | 2013-08-04 | 1 | -1/+1 |
|\ | |||||
| * | Silence compiler warning about an uninitialized variable | Raymond Hettinger | 2013-08-04 | 1 | -1/+1 |
| | | |||||
* | | Issue #16741: Fix an error reporting in int(). | Serhiy Storchaka | 2013-08-03 | 2 | -52/+64 |
|\ \ | |/ | |||||
| * | Issue #16741: Fix an error reporting in int(). | Serhiy Storchaka | 2013-08-03 | 2 | -51/+67 |
| | | |||||
* | | Minor consistency fixes for some longobject.c exception messages: | Mark Dickinson | 2013-08-03 | 1 | -4/+4 |
| | | | | | | | | | | | | - replace 'long int' / 'long' by 'int' - fix capitalization of "Python" in PyLong_AsUnsignedLong - "is too large" -> "too large", for consistency with other messages. | ||||
* | | Issue #18214: Improve finalization of Python modules to avoid setting their ↵ | Antoine Pitrou | 2013-07-31 | 1 | -8/+21 |
| | | | | | | | | globals to None, in most cases. | ||||
* | | Issue #18112: PEP 442 implementation (safe object finalization). | Antoine Pitrou | 2013-07-30 | 3 | -123/+147 |
| | | |||||
* | | Issue #18520: Fix _PyDict_GetItemId(), suppress _PyUnicode_FromId() error | Victor Stinner | 2013-07-22 | 1 | -1/+3 |
| | | | | | | | | | | As PyDict_GetItem(), _PyDict_GetItemId() suppresses all errors that may occur, for historical reasons. | ||||
* | | Issue #18520: Fix PyFunction_NewWithQualName() error handling | Victor Stinner | 2013-07-22 | 1 | -10/+9 |
| | | |||||
* | | Reindent PyFunction_NewWithQualName() | Victor Stinner | 2013-07-22 | 1 | -49/+49 |
| | | |||||
* | | Issue #18520: Add a new PyStructSequence_InitType2() function, same than | Victor Stinner | 2013-07-22 | 3 | -15/+37 |
| | | | | | | | | | | | | | | | | PyStructSequence_InitType() except that it has a return value (0 on success, -1 on error). * PyStructSequence_InitType2() now raises MemoryError on memory allocation failure * Fix also some calls to PyDict_SetItemString(): handle error | ||||
* | | Propagate error when PyByteArray_Resize() fails in bytearray_translate() | Christian Heimes | 2013-07-21 | 1 | -1/+4 |
|\ \ | |/ | | | | | CID 715334 | ||||
| * | Propagate error when PyByteArray_Resize() fails in bytearray_translate() | Christian Heimes | 2013-07-21 | 1 | -1/+4 |
| | | | | | | | | CID 715334 | ||||
* | | Check return value of PyType_Ready(&EncodingMapType) | Christian Heimes | 2013-07-20 | 1 | -1/+2 |
|\ \ | |/ | | | | | CID 486654 | ||||
| * | Check return value of PyType_Ready(&EncodingMapType) | Christian Heimes | 2013-07-20 | 1 | -1/+2 |
| | | | | | | | | CID 486654 | ||||
* | | Issue #18327: Fix argument order in call to compatible_for_assignment(oldto, ↵ | Christian Heimes | 2013-07-20 | 1 | -1/+1 |
| | | | | | | | | | | | | newto, attr). The fix only affects the error message of __class__ assignment. CID 983564 | ||||
* | | Issue #18408: Fix list_ass_slice(), handle list_resize() failure | Victor Stinner | 2013-07-19 | 1 | -3/+8 |
| | | | | | | | | | | I tested the patch manually by injecting a fault using gdb: list items are correctly restored on failure. | ||||
* | | Issue #18408: PyObject_Str(), PyObject_Repr() and type_call() now fail with an | Victor Stinner | 2013-07-17 | 2 | -0/+23 |
| | | | | | | | | | | | | | | assertion error if they are called with an exception set (PyErr_Occurred()). As PyEval_EvalFrameEx(), they may clear the current exception and so the caller looses its exception. | ||||
* | | Issue #18408: Fix dict_repr(), don't call PyObject_Repr() with an exception set | Victor Stinner | 2013-07-17 | 1 | -0/+3 |
| | | | | | | | | | | PyObject_Repr() can removes the current exception. For example, module_repr() calls PyErr_Clear() if calling loader.module_repr(mod) failed. | ||||
* | | longobject.c: add an assertion to ensure that MEDIUM_VALUE() is only called on | Victor Stinner | 2013-07-17 | 1 | -1/+2 |
| | | | | | | | | small integers (0 or 1 digit) | ||||
* | | Issue #18408: Rewrite NEGATE() macro in longobject.c to handle ↵ | Victor Stinner | 2013-07-17 | 1 | -24/+51 |
| | | | | | | | | PyLong_FromLong() failure | ||||
* | | Issue #18408: Fix PyType_Ready(), handle _PyDict_SetItemId() failure | Victor Stinner | 2013-07-17 | 1 | -3/+7 |
| | | |||||
* | | Issue #18408: Fix Py_ReprEnter(), handle PyList_Append() failure | Victor Stinner | 2013-07-17 | 1 | -1/+2 |
| | | |||||
* | | Issue #18408: Fix listpop(), handle list_ass_slice() failure | Victor Stinner | 2013-07-17 | 1 | -6/+4 |
| | | |||||
* | | Issue #18408: Fix structseq_reduce(), handle PyDict_SetItemString() failure | Victor Stinner | 2013-07-17 | 1 | -11/+13 |
| | | |||||
* | | Close #18469: Replace PyDict_GetItemString() with _PyDict_GetItemId() in ↵ | Victor Stinner | 2013-07-16 | 1 | -5/+20 |
| | | | | | | | | | | | | | | | | | | | | | | | | structseq.c _PyDict_GetItemId() is more efficient: it only builds the Unicode string once. Identifiers (dictionary keys) are now created at Python initialization, and if the creation failed, Python does exit with a fatal error. Before, PyDict_GetItemString() failure was not handled: structseq_new() could call PyObject_GC_NewVar() with a negative size, and structseq_dealloc() could also crash. | ||||
* | | Cleanup type_call() to ease debug | Victor Stinner | 2013-07-16 | 1 | -4/+6 |
| | | | | | | | | | | | | It was easy to miss the call to type->tp_init because it was done in a long conditional expression. Split the long expression in multiple lines to make the debug step by step easier. | ||||
* | | Issue #18408: Py_ReprLeave() now saves/restores the current exception, | Victor Stinner | 2013-07-16 | 1 | -2/+11 |
| | | | | | | | | and ignores exceptions raised during the call | ||||
* | | Issue #18408: dict_new() now fails on new_keys_object() error | Victor Stinner | 2013-07-16 | 1 | -10/+9 |
| | | | | | | | | Pass the MemoryError exception to the caller, instead of using empty keys. | ||||
* | | Cleanup dictobject.c | Victor Stinner | 2013-07-16 | 1 | -17/+19 |
| | | |||||
* | | Issue #18408: Fix PyDict_GetItemString(), suppress PyUnicode_FromString() error | Victor Stinner | 2013-07-16 | 1 | -1/+3 |
| | | | | | | | | | | As PyDict_GetItem(), PyDict_GetItemString() suppresses all errors that may occur for historical reasons. | ||||
* | | Issue #18408: Fix list.extend(), handle list_resize() failure | Victor Stinner | 2013-07-16 | 1 | -2/+4 |
| | | |||||
* | | Issue #18408: add more assertions on PyErr_Occurred() in ceval.c to detect bugs | Victor Stinner | 2013-07-15 | 1 | -2/+1 |
| | | | | | | | | earlier | ||||
* | | Issue #18408: type_new() and PyType_FromSpecWithBases() now raise MemoryError | Victor Stinner | 2013-07-15 | 1 | -2/+6 |
| | | | | | | | | on memory allocation failure | ||||
* | | Issue #18408: Don't check unicode consistency in _PyUnicode_HAS_UTF8_MEMORY() | Victor Stinner | 2013-07-15 | 1 | -4/+2 |
| | | | | | | | | | | | | | | | | | | | | | | and _PyUnicode_HAS_WSTR_MEMORY() macros These macros are called in unicode_dealloc(), whereas the unicode object can be "inconsistent" if the creation of the object failed. For example, when unicode_subtype_new() fails on a memory allocation, _PyUnicode_CheckConsistency() fails with an assertion error because data is NULL. | ||||
* | | Issue #18408: PyObject_Call() now fails with an assertion error in debug mode | Victor Stinner | 2013-07-15 | 1 | -1/+7 |
| | | | | | | | | | | if the function called failed whereas no exception was raised, to detect bugs earlier. | ||||
* | | Issue #18408: pmerge() help of mro_implementation() now raises MemoryError on | Victor Stinner | 2013-07-11 | 1 | -2/+4 |
| | | | | | | | | | | | | | | memory allocation failure Replace also PyMem_Free() with PyMem_FREE() to be consistent with the rest of the function. | ||||
* | | Issue #18408: In debug mode, PyCFunction_Call() now checks if an exception was | Victor Stinner | 2013-07-11 | 1 | -7/+23 |
| | | | | | | | | | | raised if the result is NULL to help to find bugs in C mode (get the error earlier than the SystemError in ceval.c). | ||||
* | | Issue #18408: slot_tp_str() must not fallback on slot_tp_repr() on error | Victor Stinner | 2013-07-11 | 1 | -19/+2 |
| | | | | | | | | | | | | | | | | | | type->tp_str must not point to slot_tp_str() if type has no __str__ attribute, so there is no reason for slot_tp_str() to fallback on slot_tp_str() on lookup error. Moreover, calling PyErr_Clear() may hide a real bug like MemoryError. If __str__ attribute is removed, slots must be updated (which is done by type_setattro()). | ||||
* | | typeobject.c: remove trailing spaces | Victor Stinner | 2013-07-11 | 1 | -3/+3 |
| | | |||||
* | | Issue #18408: Fix _PyMem_DebugRealloc() | Victor Stinner | 2013-07-08 | 1 | -6/+8 |
| | | | | | | | | | | | | | | | | Don't mark old extra memory dead before calling realloc(). realloc() can fail and realloc() must not touch the original buffer on failure. So mark old extra memory dead only on success if the new buffer did not move (has the same address). | ||||
* | | Issue #18408: _PyUnicodeWriter_Finish() now clears its buffer attribute in all | Victor Stinner | 2013-07-08 | 1 | -3/+6 |
| | | | | | | | | cases, so _PyUnicodeWriter_Dealloc() can be called after finish. | ||||
* | | Issue #18408: Fix _PyUnicodeWriter_Finish(): clear writer->buffer, | Victor Stinner | 2013-07-08 | 1 | -2/+5 |
| | | | | | | | | so _PyUnicodeWriter_Dealloc() can be called on the writer after finish. | ||||
* | | Issue #18408: Fix PyType_Ready() and type.__bases__ setter to handle | Victor Stinner | 2013-07-08 | 1 | -0/+2 |
| | | | | | | | | PyWeakref_NewRef() failure (ex: MemoryError). | ||||
* | | Issue #18408: Fix list.pop() to handle list_resize() failure (MemoryError). | Victor Stinner | 2013-07-08 | 1 | -2/+4 |
| | | |||||
* | | Issue #18408: Fix PyDict_New() to handle correctly new_keys_object() failure | Victor Stinner | 2013-07-08 | 1 | -1/+5 |
| | | | | | | | | (MemoryError). | ||||
* | | Issue #18203: Add _PyMem_RawStrdup() and _PyMem_Strdup() | Victor Stinner | 2013-07-07 | 1 | -0/+28 |
| | | | | | | | | | | Replace strdup() with _PyMem_RawStrdup() or _PyMem_Strdup(), depending if the GIL is held or not. | ||||
* | | Issue #18203: Fix _Py_DecodeUTF8_surrogateescape(), use PyMem_RawMalloc() as ↵ | Victor Stinner | 2013-07-07 | 1 | -2/+2 |
| | | | | | | | | _Py_char2wchar() |