cpython/Objects
Greg Price 0711642eec Cut tricky `goto` that isn't needed, in _PyBytes_DecodeEscape. (GH-15825)
This is the sort of `goto` that requires the reader to stare hard at
the code to unpick what it's doing.

On doing so, the answer is... not very much!

* It jumps from the bottom of the loop to almost the top; the effect
  is to bypass the loop condition `s < end` and also the
  `if`-condition `*s != '\\'`, acting as if both are true.

* We've just decremented `s`, after incrementing it in the `switch`
  condition.  So it has the same value as when `s == end` failed.
  Before that was another increment... and before that we had
  `s < end`.  So `s < end` true, then increment, then `s == end`
  false... that means `s < end` is still true.

* Also this means `s` points to the same character as it did for the
  `switch` condition.  And there was a `case '\\'`, which we didn't
  hit -- so `*s != '\\'` is also true.

* That means this has no effect on the behavior!  The most it might do
  is an optimization -- we get to skip those two checks, because (as
  just proven above) we know they're true.

* But gosh, this is the *invalid escape sequence* path.  This does not
  seem like the kind of code path that calls for extreme optimization
  tricks.

So, take the `goto` and the label out.

Perhaps the compiler will notice the exact same facts we showed above,
and generate identical code.  Or perhaps it won't!  That'll be OK.

But then, crucially, if some future edit to this loop causes the
reasoning above to *stop* holding true... the compiler will adjust
this jump accordingly.  One of us fallible humans might not.
2019-09-10 09:51:04 +01:00
..
clinic bpo-37034: Display argument name on errors with keyword arguments with Argument Clinic. (GH-13593) 2019-08-29 17:49:08 +03:00
stringlib bpo-37034: Display argument name on errors with keyword arguments with Argument Clinic. (GH-13593) 2019-08-29 17:49:08 +03:00
README Issue #18093: Factor out the programs that embed the runtime 2014-07-25 21:52:14 +10:00
abstract.c abstract.c should not be executable. (GH-15348) 2019-08-20 19:19:43 -07:00
accu.c bpo-35081: Move accu.h to Include/internal/pycore_accu.h (GH-10271) 2018-11-01 02:30:36 +01:00
boolobject.c bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async (GH-13464) 2019-05-30 19:13:39 -07:00
bytearrayobject.c bpo-37840: Fix handling of negative indices in bytearray_getitem() (GH-15250) 2019-09-09 09:28:34 -07:00
bytes_methods.c closes bpo-34599: Improve performance of _Py_bytes_capitalize(). (GH-9083) 2018-09-06 21:54:49 -07:00
bytesobject.c Cut tricky `goto` that isn't needed, in _PyBytes_DecodeEscape. (GH-15825) 2019-09-10 09:51:04 +01:00
call.c bpo-37540: vectorcall: keyword names must be strings (GH-14682) 2019-08-16 03:41:27 -07:00
capsule.c bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async (GH-13464) 2019-05-30 19:13:39 -07:00
cellobject.c bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async (GH-13464) 2019-05-30 19:13:39 -07:00
classobject.c Make PyXXX_Fini() functions private (GH-15531) 2019-08-27 00:12:32 +02:00
codeobject.c bpo-37221: Add PyCode_NewWithPosOnlyArgs to be used internally and set PyCode_New as a compatibility wrapper (GH-13959) 2019-07-01 12:35:05 +02:00
complexobject.c bpo-37236: pragma optimize off for _Py_c_quot on Windows arm64 (GH-13983) 2019-06-12 11:08:40 -07:00
descrobject.c bpo-37994: Fix silencing all errors if an attribute lookup fails. (GH-15630) 2019-09-01 12:03:39 +03: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 Make PyXXX_Fini() functions private (GH-15531) 2019-08-27 00:12:32 +02:00
enumobject.c bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async (GH-13464) 2019-05-30 19:13:39 -07:00
exceptions.c bpo-37757: Disallow PEP 572 cases that expose implementation details (GH-15131) 2019-08-25 23:45:40 +10:00
fileobject.c bpo-15999: Clean up of handling boolean arguments. (GH-15610) 2019-09-01 12:16:51 +03:00
floatobject.c Make PyXXX_Fini() functions private (GH-15531) 2019-08-27 00:12:32 +02:00
frameobject.c Make PyXXX_Fini() functions private (GH-15531) 2019-08-27 00:12:32 +02:00
funcobject.c bpo-19072: Make @classmethod support chained decorators (GH-8405) 2019-08-24 15:37:25 -07:00
genobject.c bpo-15088 : Remove PyGen_NeedsFinalizing() (GH-15702) 2019-09-06 17:41:38 +02:00
interpreteridobject.c bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async (GH-13464) 2019-05-30 19:13:39 -07:00
iterobject.c bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async (GH-13464) 2019-05-30 19:13:39 -07:00
listobject.c bpo-36946:Fix possible signed integer overflow when handling slices. (GH-15639) 2019-09-08 13:15:56 +03:00
listsort.txt Fix typos mostly in comments, docs and test names (GH-15209) 2019-08-30 16:21:19 -04:00
lnotab_notes.txt bpo-28810: Update lnotab_notes.txt (#665) 2017-03-14 21:42:09 +02:00
longobject.c replace inline function `is_small_int` with a macro version (GH-15710) 2019-09-05 23:00:56 -07:00
memoryobject.c bpo-37483: add _PyObject_CallOneArg() function (#14558) 2019-07-04 19:31:34 +09:00
methodobject.c Make PyXXX_Fini() functions private (GH-15531) 2019-08-27 00:12:32 +02:00
moduleobject.c bpo-37483: add _PyObject_CallOneArg() function (#14558) 2019-07-04 19:31:34 +09:00
namespaceobject.c bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async (GH-13464) 2019-05-30 19:13:39 -07:00
object.c Fix typos in comments, docs and test names (#15018) 2019-07-30 18:16:13 -04:00
obmalloc.c bpo-37732: Fix GCC warning in _PyObject_Malloc() (GH-15333) 2019-08-20 12:28:02 +01:00
odictobject.c bpo-37337: Add _PyObject_CallMethodNoArgs() (GH-14267) 2019-07-08 17:19:25 +09:00
picklebufobject.c bpo-36785: PEP 574 implementation (GH-7076) 2019-05-26 17:10:09 +02:00
rangeobject.c bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async (GH-13464) 2019-05-30 19:13:39 -07:00
setobject.c bpo-37994: Fix silencing all errors if an attribute lookup fails. (GH-15630) 2019-09-01 12:03:39 +03:00
sliceobject.c Make PyXXX_Fini() functions private (GH-15531) 2019-08-27 00:12:32 +02:00
structseq.c Call PyObject_GC_UnTrack in structseq dealloc (GH-13751) 2019-06-02 21:52:49 +01:00
tupleobject.c Correct overflow check in PyTuple_New() (GH-14838) 2019-09-09 13:40:58 -07:00
typeobject.c bpo-37994: Fix silencing all errors if an attribute lookup fails. (GH-15630) 2019-09-01 12:03:39 +03: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 Fix unused variable and signed/unsigned warnings (GH-15537) 2019-08-27 09:55:13 -07:00
unicodetype_db.h closes bpo-36861: Update Unicode database to 12.1.0. (GH-13214) 2019-05-08 20:59:35 -07:00
weakrefobject.c bpo-37994: Fix silencing all errors if an attribute lookup fails. (GH-15630) 2019-09-01 12:03:39 +03:00

README

Source files for various builtin objects