cpython/Objects
Gregory P. Smith 397f1b28c4
bpo-33312: Fix clang ubsan out of bounds warnings in dict. (GH-6537)
Fix clang ubsan (undefined behavior sanitizer) warnings in dictobject.c by
adjusting how the internal struct _dictkeysobject shared keys structure is
declared.

This remains ABI compatible.  We get rid of the union at the end of the
struct being used for conveinence to avoid typecasting in favor of char[]
variable length array at the end of a struct. This is known to clang to be
used for variable sized objects and will not cause an undefined behavior
problem.  Similarly, char arrays do not have strict aliasing undefined
behavior when cast.

PEP-007 does not currently list variable length arrays (VLAs) as allowed
in our subset of C99.  If this turns out to be a problem, the fix to this is
to change the char `dk_indices[]` into `dk_indices[1]` and restore the
three size computation subtractions this change removes:
  `- Py_MEMBER_SIZE(PyDictKeysObject, dk_indices)`

If this works as is I'll make a separate PR to update PEP-007.
2018-04-19 22:41:19 -07:00
..
clinic bpo-32677: Add .isascii() to str, bytes and bytearray (GH-5342) 2018-01-27 14:06:21 +09:00
stringlib bpo-32677: Add .isascii() to str, bytes and bytearray (GH-5342) 2018-01-27 14:06:21 +09:00
README Issue #18093: Factor out the programs that embed the runtime 2014-07-25 21:52:14 +10:00
abstract.c bpo-32571: Avoid raising unneeded AttributeError and silencing it in C code (GH-5222) 2018-01-25 17:49:40 +09:00
accu.c Replace KB unit with KiB (#4293) 2017-11-08 14:44:44 -08:00
boolobject.c bpo-30592: Fixed error messages for some builtins. (#1996) 2017-06-08 14:41:19 +03:00
bytearrayobject.c bpo-32677: Add .isascii() to str, bytes and bytearray (GH-5342) 2018-01-27 14:06:21 +09:00
bytes_methods.c bpo-32677: Optimize str.isascii() (GH-5356) 2018-01-28 09:59:12 +09:00
bytesobject.c bpo-32677: Add .isascii() to str, bytes and bytearray (GH-5342) 2018-01-27 14:06:21 +09:00
call.c bpo-32240: Add the const qualifier to declarations of PyObject* array arguments. (#4746) 2017-12-15 13:11:11 +02:00
capsule.c
cellobject.c bpo-23699: Use a macro to reduce boilerplate code in rich comparison functions (GH-793) 2017-11-02 20:32:54 +10:00
classobject.c bpo-32571: Avoid raising unneeded AttributeError and silencing it in C code (GH-5222) 2018-01-25 17:49:40 +09:00
codeobject.c bpo-33299: Return an object itself for some types in _PyCode_ConstantKey(). (GH-6513) 2018-04-19 08:28:04 +03:00
complexobject.c bpo-31979: Simplify transforming decimals to ASCII (#4336) 2017-11-13 21:23:48 +02:00
descrobject.c bpo-31787: Prevent refleaks when calling __init__() more than once (GH-3995) 2018-02-13 19:28:33 +09:00
dict-common.h bpo-33312: Fix clang ubsan out of bounds warnings in dict. (GH-6537) 2018-04-19 22:41:19 -07:00
dictnotes.txt Issue #15055: update dictnotes.txt. Patch by Mark Shannon. 2012-06-24 21:03:45 +02:00
dictobject.c bpo-33312: Fix clang ubsan out of bounds warnings in dict. (GH-6537) 2018-04-19 22:41:19 -07:00
enumobject.c bpo-31579: Fixed a possible leak in enumerate() with large indices. (#3753) 2017-09-26 08:14:58 +03:00
exceptions.c bpo-32685: Improve suggestion for print statement (GH-5375) 2018-01-28 20:56:02 +10:00
fileobject.c bpo-29548: Fix some inefficient call API usage (GH-97) 2017-02-16 09:26:01 +09:00
floatobject.c Fix typo and edit for clarity in the docstrings of sys.float_info. (GH-2251) 2018-03-26 12:41:30 +03:00
frameobject.c bpo-30953: Improve error messages and add tests for jumping (GH-6196) 2018-03-23 14:46:45 +02:00
funcobject.c bpo-31787: Prevent refleaks when calling __init__() more than once (GH-3995) 2018-02-13 19:28:33 +09:00
genobject.c bpo-17611. Move unwinding of stack for "pseudo exceptions" from interpreter to compiler. (GH-5006) 2018-02-22 23:33:30 +02:00
iterobject.c bpo-30860: Consolidate stateful runtime globals. (#3397) 2017-09-07 23:51:28 -06:00
listobject.c closes bpo-32898: Fix debug build crash with COUNT_ALLOCS (GH-5800) 2018-02-21 20:55:18 -08:00
listsort.txt bpo-28685: Optimize sorted() list.sort() with type-specialized comparisons (#582) 2018-01-28 19:03:23 -08:00
lnotab_notes.txt bpo-28810: Update lnotab_notes.txt (#665) 2017-03-14 21:42:09 +02:00
longobject.c PyLong_FromString(): fix Coverity CID 1424951 (#4738) 2017-12-08 00:06:55 +01:00
memoryobject.c bpo-33176: Add a toreadonly() method to memoryviews. (GH-6466) 2018-04-14 19:49:21 +02:00
methodobject.c bpo-30860: Consolidate stateful runtime globals. (#3397) 2017-09-07 23:51:28 -06:00
moduleobject.c bpo-32374: m_traverse may be called with m_state=NULL (GH-5140) 2018-03-17 15:41:20 +10:00
namespaceobject.c bpo-31655: Validate keyword names in SimpleNamespace constructor. (#3909) 2017-10-07 22:59:35 +03:00
object.c closes bpo-32898: Fix debug build crash with COUNT_ALLOCS (GH-5800) 2018-02-21 20:55:18 -08:00
obmalloc.c remove vestigal locking from obmalloc (GH-5805) 2018-02-24 11:59:10 -08:00
odictobject.c bpo-33031: Remove dead code in C implementation of OrderedDict. (GH-6120) 2018-04-09 19:14:26 +03:00
rangeobject.c bpo-30592: Fixed error messages for some builtins. (#1996) 2017-06-08 14:41:19 +03:00
setobject.c Removed unnecesssary bit inversion which doesn't improve dispersion statistics (#5235) 2018-01-18 13:23:27 -08:00
sliceobject.c bpo-30860: Consolidate stateful runtime globals. (#3397) 2017-09-07 23:51:28 -06:00
structseq.c bpo-29793: Convert some builtin types constructors to Argument Clinic. (#615) 2017-03-19 08:51:07 +02:00
tupleobject.c closes bpo-32898: Fix debug build crash with COUNT_ALLOCS (GH-5800) 2018-02-21 20:55:18 -08:00
typeobject.c bpo-32746: Fix multiple typos (GH-5144) 2018-02-03 19:36:10 -05:00
typeslots.inc add Py_tp_finalize slot (closes #24345) 2015-06-01 10:12:48 -05:00
typeslots.py Issue #26662: Set PYTHON_FOR_GEN in configure 2016-07-26 12:48:08 +02:00
unicodectype.c Removed unintentional trailing spaces in non-external and non-generated C files. 2015-03-18 21:53:15 +02:00
unicodeobject.c bpo-29803: remove a redandunt op and fix a comment in unicodeobject.c (#660) 2018-02-13 18:33:32 +08:00
unicodetype_db.h bpo-30736: upgrade to Unicode 10.0 (#2344) 2017-06-22 22:31:08 -07:00
weakrefobject.c bpo-30592: Fixed error messages for some builtins. (#1996) 2017-06-08 14:41:19 +03:00

README

Source files for various builtin objects