cpython/Objects
Gregory P. Smith 27dc02e8c5 Fix the internals of our hash functions to used unsigned values during hash
computation as the overflow behavior of signed integers is undefined.

NOTE: This change is smaller compared to 3.2 as much of this cleanup had
already been done.  I added the comment that my change in 3.2 added so that the
code would match up.  Otherwise this just adds or synchronizes appropriate UL
designations on some constants to be pedantic.

In practice we require compiling everything with -fwrapv which forces overflow
to be defined as twos compliment but this keeps the code cleaner for checkers
or in the case where someone has compiled it without -fwrapv or their
compiler's equivalent.  We could work to get rid of the -fwrapv requirement
in 3.4 but that requires more planning.

Found by Clang trunk's Undefined Behavior Sanitizer (UBSan).

Cleanup only - no functionality or hash values change.
2012-12-10 19:51:29 -08:00
..
stringlib Issue #16592: stringlib_bytes_join doesn't raise MemoryError on allocation failure 2012-12-02 07:56:42 +01:00
abstract.c Issue #16148: Small improvements and cleanup. Added version information 2012-10-07 10:29:32 +02:00
accu.c Issue #14387: Do not include accu.h from Python.h. 2012-03-22 14:38:16 +01:00
boolobject.c Recorded merge of revisions 81032 via svnmerge from 2010-05-09 16:14:21 +00:00
bytearrayobject.c Fix compilation on Windows 2012-11-03 23:08:27 +01:00
bytes_methods.c Issue #13738: Simplify implementation of bytes.lower() and bytes.upper(). 2012-01-08 16:22:46 +01:00
bytesobject.c Fix the internals of our hash functions to used unsigned values during hash 2012-12-10 18:15:46 -08:00
capsule.c Issue #2443: Added a new macro, Py_VA_COPY, which is equivalent to C99 2010-08-11 17:31:17 +00:00
cellobject.c Recorded merge of revisions 81032 via svnmerge from 2010-05-09 16:14:21 +00:00
classobject.c Py_TYPE() has already dereferenced self before the NULL check. Moved Py_TYPE() after the check for self == NULL 2012-09-10 02:45:56 +02:00
codeobject.c Issue #15456: Fix code __sizeof__ after #12399 change. 2012-07-26 22:23:23 +02:00
complexobject.c Issue #16290: __complex__ must now always return an instance of complex. 2012-11-14 17:08:31 +00:00
descrobject.c merge 3.2 (#14699) 2012-05-01 09:51:46 -04:00
dictnotes.txt Issue #15055: update dictnotes.txt. Patch by Mark Shannon. 2012-06-24 21:03:45 +02:00
dictobject.c Issue #16562: Optimize dict equality testing. 2012-12-02 19:10:07 +01:00
enumobject.c Issue #14288: Serialization support for builtin iterators. 2012-04-03 10:49:41 +00:00
exceptions.c Issue #15784: Modify OSError.__str__() to better distinguish between 2012-08-28 19:33:26 +01:00
fileobject.c Rename _Py_identifier to _Py_IDENTIFIER. 2011-10-14 10:20:37 +02:00
floatobject.c Issue #14785: Add sys._debugmallocstats() to help debug low-level memory allocation issues 2012-06-22 14:55:41 -04:00
frameobject.c Issue #9566: Use the right type to fix a compiler warnings on Win64 2012-10-31 00:37:41 +01:00
funcobject.c use new generic __dict__ descriptor implementations 2012-02-19 20:02:57 -05:00
genobject.c Issue #13783: PEP 380 cleanup part 2, using the new identifier APIs in the generator implementation 2012-06-17 15:45:11 +10:00
iterobject.c Fixed a missing incref introduced by a7ec0a1b0f7c 2012-10-06 14:30:32 +02:00
listobject.c Issue #16148: implemented PEP 424 2012-10-06 14:03:24 +02:00
listsort.txt Merged revisions 74613,74615,74619-74620,74622 via svnmerge from 2009-09-01 08:13:16 +00:00
lnotab_notes.txt Merged revisions 72487-72488,72879 via svnmerge from 2009-07-21 04:30:03 +00:00
longobject.c Issue 16280: Drop questionable special-casing of null pointer in PyLong_FromVoidPtr. 2012-10-18 22:18:42 +01:00
memoryobject.c Issue #15814: Use hash function that is compatible with the equality 2012-11-02 17:49:22 +01:00
methodobject.c Issue #14785: Add sys._debugmallocstats() to help debug low-level memory allocation issues 2012-06-22 14:55:41 -04:00
moduleobject.c Issue #15394: Fix ref leaks in PyModule_Create. 2012-07-19 13:51:59 -05:00
namespaceobject.c Close #16160: Subclass support now works for types.SimpleNamespace. Thanks to RDM for noticing. 2012-10-16 22:35:38 -07:00
object.c initialize map/filter/zip in _PyBuiltin_Init rather than the catch-all function 2012-10-30 23:41:54 -04:00
obmalloc.c Issue #13390: New function :func:`sys.getallocatedblocks()` returns the number of memory blocks currently allocated. 2012-12-09 14:28:26 +01:00
rangeobject.c Issue #16451: Refactor to remove duplication between range and slice in slice index computations. 2012-11-17 19:18:10 +00:00
setobject.c Fix the internals of our hash functions to used unsigned values during hash 2012-12-10 18:32:53 -08:00
sliceobject.c Issue #16451: Refactor to remove duplication between range and slice in slice index computations. 2012-11-17 19:18:10 +00:00
structseq.c Check for NULL return value in PyStructSequence_NewType(). Found by Coverity. 2012-08-19 11:20:41 +02:00
tupleobject.c Fix the internals of our hash functions to used unsigned values during hash 2012-12-10 18:32:53 -08:00
typeobject.c merge 3.3 2012-10-31 00:04:42 -04:00
typeslots.inc remove __version__s dependent on subversion keyword expansion (closes #12221) 2011-05-31 20:52:17 -05:00
typeslots.py remove __version__s dependent on subversion keyword expansion (closes #12221) 2011-05-31 20:52:17 -05:00
unicodectype.c fix old titlecase function for extended case chars 2012-01-15 21:33:32 -05:00
unicodeobject.c Fix the internals of our hash functions to used unsigned values during hash 2012-12-10 19:51:29 -08:00
unicodetype_db.h upgrade to UCD 6.2 2012-09-29 13:47:39 -04:00
weakrefobject.c Issue #16602: When a weakref's target was part of a long deallocation chain, the object could remain reachable through its weakref even though its refcount had dropped to zero. 2012-12-08 21:17:03 +01:00