summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
...
* gh-88057: in compile.c, assertion that stackdepth is alway >=0 is missing in ↵Irit Katriel2022-09-071-0/+1
| | | | one place (GH-96513)
* GH-91432: Remove the iterator_exhausted_no_error label (GH-96517)Brandt Bucher2022-09-071-16/+20
|
* GH-96572: fix use after free in trace refs build mode (#96618)Kumar Aditya2022-09-061-1/+1
|
* GH-96569: Add two NULL checks to avoid undefined behavior. (GH-96585)Mark Shannon2022-09-061-8/+5
|
* GH-93911: Fix `LOAD_ATTR_PROPERTY` caches (GH-96519)Brandt Bucher2022-09-061-5/+5
|
* ceval.c's GETITEM should have asserts, not set exceptions (GH-96518)Dennis Sweeney2022-09-041-2/+8
|
* gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96499)Gregory P. Smith2022-09-023-3/+186
| | | | | | | | | | | | | | | | Integer to and from text conversions via CPython's bignum `int` type is not safe against denial of service attacks due to malicious input. Very large input strings with hundred thousands of digits can consume several CPU seconds. This PR comes fresh from a pile of work done in our private PSRT security response team repo. Signed-off-by: Christian Heimes [Red Hat] <christian@python.org> Tons-of-polishing-up-by: Gregory P. Smith [Google] <greg@krypto.org> Reviews via the private PSRT repo via many others (see the NEWS entry in the PR). <!-- gh-issue-number: gh-95778 --> * Issue: gh-95778 <!-- /gh-issue-number --> I wrote up [a one pager for the release managers](https://docs.google.com/document/d/1KjuF_aXlzPUxTK4BMgezGJ2Pn7uevfX7g0_mvgHlL7Y/edit#). Much of that text wound up in the Issue. Backports PRs already exist. See the issue for links.
* gh-93554: Conditional jump opcodes only jump forward (GH-96318)Irit Katriel2022-09-014-220/+112
|
* gh-93678: apply remove_redundant_jumps in optimize_cfg (GH-96274)Irit Katriel2022-09-011-11/+33
|
* Remove the binary_subscr_dict_error label (GH-96443)Brandt Bucher2022-08-301-11/+4
|
* gh-96143: Allow Linux perf profiler to see Python calls (GH-96123)Pablo Galindo Salgado2022-08-304-1/+201
| | | | | | | :warning: :warning: Note for reviewers, hackers and fellow systems/low-level/compiler engineers :warning: :warning: If you have a lot of experience with this kind of shenanigans and want to improve the **first** version, **please make a PR against my branch** or **reach out by email** or **suggest code changes directly on GitHub**. If you have any **refinements or optimizations** please, wait until the first version is merged before starting hacking or proposing those so we can keep this PR productive.
* GH-96237: Allow non-functions as reference-holder in frames. (GH-96238)Mark Shannon2022-08-252-7/+11
|
* GH-93503: Add thread-specific APIs to set profiling and tracing functions in ↵Pablo Galindo Salgado2022-08-243-1/+131
| | | | | | | | | | | | | | | | | the C-API (#93504) * gh-93503: Add APIs to set profiling and tracing functions in all threads in the C-API * Use a separate API * Fix NEWS entry * Add locks around the loop * Document ignoring exceptions * Use the new APIs in the sys module * Update docs
* gh-87092: use basicblock_last_instr consistently in the compiler (GH-96243)Irit Katriel2022-08-241-29/+32
|
* GH-96177: Move GIL and eval breaker code out of ceval.c into ceval_gil.c. ↵Mark Shannon2022-08-243-974/+987
| | | | (GH-96204)
* gh-93678: add _testinternalcapi.optimize_cfg() and test utils for compiler ↵Irit Katriel2022-08-241-48/+210
| | | | optimization unit tests (GH-96007)
* GH-96071: fix deadlock in PyGILState_Ensure (GH-96124)Kumar Aditya2022-08-191-11/+16
| | | Alternative of #96107
* gh-96125: Fix sys.thread_info.name on pthread platforms (GH-96126)Christian Heimes2022-08-191-1/+1
| | | Automerge-Triggered-By: GH:tiran
* GH-90997: Wrap yield from/await in a virtual try/except StopIteration (GH-96010)Brandt Bucher2022-08-193-19/+49
|
* gh-96017: Fix some compiler warnings (GH-96018)Christian Heimes2022-08-191-0/+2
| | | | | - "comparison of integers of different signs" in typeobject.c - only define static_builtin_index_is_set in DEBUG builds - only define recreate_gil with ifdef HAVE_FORK
* Remove dead code in _PyDict_GetItemHint and rename to _PyDict_LookupIndex ↵Matthias Görgens2022-08-181-9/+6
| | | | (GH-95948)
* GH-93911: Specialize `LOAD_ATTR` for custom `__getattribute__` (GH-93988)Ken Jin2022-08-174-32/+158
|
* GH-95909: Make `_PyArg_Parser` initialization thread safe (GH-95958)Kumar Aditya2022-08-162-12/+44
|
* gh-95853: Add script to automate WASM build (GH-95828)Christian Heimes2022-08-131-3/+7
| | | | | | | | | | | | Automate WASM build with a new Python script. The script provides several build profiles with configure flags for Emscripten flavors and WASI. The script can detect and use Emscripten SDK and WASI SDK from default locations or env vars. ``configure`` now detects Node arguments and creates HOSTRUNNER arguments for Node 16. It also sets correct arguments for ``wasm64-emscripten``. Co-authored-by: Brett Cannon <brett@python.org>
* gh-90928: Improve static initialization of keywords tuple in AC (#95907)Erlend E. Aasland2022-08-136-261/+111
|
* gh-95922: compiler's eliminate_empty_basic_blocks ignores the last block of ↵Irit Katriel2022-08-121-8/+5
| | | | the compilation unit (GH-95924)
* gh-90928: Statically Initialize the Keywords Tuple in Clinic-Generated Code ↵Eric Snow2022-08-1110-104/+716
| | | | | | | | | | | | | | | | (gh-95860) We only statically initialize for core code and builtin modules. Extension modules still create the tuple at runtime. We'll solve that part of interpreter isolation separately. This change includes generated code. The non-generated changes are in: * Tools/clinic/clinic.py * Python/getargs.c * Include/cpython/modsupport.h * Makefile.pre.in (re-generate global strings after running clinic) * very minor tweaks to Modules/_codecsmodule.c and Python/Python-tokenize.c All other changes are generated code (clinic, global strings).
* gh-87092: compiler's codegen stage uses int jump target labels, and the ↵Irit Katriel2022-08-111-70/+52
| | | | target pointer is only calculated just before optimization stage (GH-95655)
* GH-95818: Skip incomplete frames in `PyThreadState_GetFrame` (GH-95886)Mark Shannon2022-08-111-2/+6
|
* Update _PyEval_AddPendingCall comment (#95817)zhanpon2022-08-111-2/+2
|
* gh-93243: Make smtpd private before porting its users (GH-93246)Oleg Iarygin2022-08-061-1/+0
| | | | | | | gh-93243 This PR is required to reduce diffs of the following porting (no need to either maintain documentation and tests consistent with each porting step, or try to port everything and remove smtpd in a single PR). Automerge-Triggered-By: GH:warsaw
* gh-87092: create a 'jump target label' abstraction so that the compiler's ↵Irit Katriel2022-08-041-354/+385
| | | | codegen stage does not work directly with basic blocks (GH-95398)
* GH-95245: Store object values and dict pointers in single tagged pointer. ↵Mark Shannon2022-08-012-15/+20
| | | | (GH-95278)
* bpo-45445: Revert "bpo-45445: Fail if an invalid X-option is provided in the ↵Pablo Galindo Salgado2022-07-311-48/+0
| | | | command line (GH-28823)" (#94745)
* GH-90081: Run python tracers at full speed (GH-95328)Mark Shannon2022-07-281-4/+7
|
* gh-94938: Fix errror detection of unexpected keyword arguments (GH-94999)Serhiy Storchaka2022-07-281-85/+57
| | | | | | | | | | When keyword argument name is an instance of a str subclass with overloaded methods __eq__ and __hash__, the former code could not find the name of an extraneous keyword argument to report an error, and _PyArg_UnpackKeywords() returned success without setting the corresponding cell in the linearized arguments array. But since the number of expected initialized cells is determined as the total number of passed arguments, this lead to reading NULL as a keyword parameter value, that caused SystemError or crash or other undesired behavior.
* gh-95174: Add pthread stubs for WASI (GH-95234)Christian Heimes2022-07-273-6/+201
| | | Co-authored-by: Brett Cannon <brett@python.org>
* gh-93678: extract 'struct cfg_builder' from the compiler so that the CFG can ↵Irit Katriel2022-07-261-120/+113
| | | | be manipulated directly (GH-95107)
* gh-95174: Handle missing dup() and constants in WASI (GH-95229)Christian Heimes2022-07-262-1/+11
| | | | | | | - check for ``dup()`` libc function - handle missing ``F_DUPFD`` in ``dup2()`` replacement function - add workaround for WASI libc bug in MSG_TRUNC - ESHUTDOWN is missing, use EPIPE instead - POLLPRI is missing, define as 0 (no-op)
* gh-94673: Always Finalize Static Builtin Types (#95153)Eric Snow2022-07-251-1/+2
| | | | | | | | | | | | | Static builtin types are finalized by calling _PyStaticType_Dealloc(). Before this change, we were skipping finalizing such a type if it still had subtypes (i.e. its tp_subclasses hadn't been cleared yet). The problem is that types hold several heap objects, which leak if we skip the type's finalization. This change addresses that. For context, there's an old comment (from e9e3eab0b86) that says the following: // If a type still has subtypes, it cannot be deallocated. // A subtype can inherit attributes and methods of its parent type, // and a type must no longer be used once it's deallocated. However, it isn't clear that is actually still true. Clearing tp_dict should mean it isn't a problem. Furthermore, the only subtypes that might still be around come from extension modules that didn't clean them up when unloaded (i.e. extensions that do not implement multi-phase initialization, AKA PEP 489). Those objects are already leaking, so this change doesn't change anything in that regard. Instead, this change means more objects gets cleaned up that before.
* gh-94673: Add _PyStaticType_InitBuiltin() (#95152)Eric Snow2022-07-253-26/+22
| | | | | | | | | | | | This is the first of several precursors to storing tp_subclasses (and tp_weaklist) on the interpreter state for static builtin types. We do the following: * add `_PyStaticType_InitBuiltin()` * add `_Py_TPFLAGS_STATIC_BUILTIN` * set it on all static builtin types in `_PyStaticType_InitBuiltin()` * shuffle some code around to be able to use _PyStaticType_InitBuiltin() * rename `_PyStructSequence_InitType()` to `_PyStructSequence_InitBuiltinWithFlags()` * add `_PyStructSequence_InitBuiltin()`.
* GH-94851: check refcnt of immortal objects after finalization (GH-95001)Kumar Aditya2022-07-251-0/+3
|
* gh-95185: Check recursion depth in the AST constructor (#95186)Pablo Galindo Salgado2022-07-241-1/+106
| | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* GH-94036: Fix more attribute location quirks (GH-95028)Brandt Bucher2022-07-221-20/+23
|
* GH-95113: Don't use EXTENDED_ARG_QUICK in unquickened code (GH-95121)Brandt Bucher2022-07-223-3/+14
|
* GH-91409: Don't overwrite valid locations with NOP locations (GH-95067)Brandt Bucher2022-07-201-1/+4
|
* gh-91102: Port 8-argument _warnings.warn_explicit to Argument Clinic (#92891)Oleg Iarygin2022-07-202-25/+105
| | | Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* GH-94851: fix immortal objects refcounting in compiler (gh-95040)Kumar Aditya2022-07-201-1/+1
|
* gh-91256: Ensure help text has the program name even before getpath is ↵Steve Dower2022-07-191-0/+3
| | | | called (GH-94929)
* gh-93678: move normalize_basic_block and extend_block call into optimize_cfg ↵Irit Katriel2022-07-191-31/+26
| | | | (GH-95002)