summaryrefslogtreecommitdiffstats
path: root/Tools/c-analyzer/cpython/_parser.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-142025: Add c-analyzer include for pyexpat.c (GH-142026)dgpb2025-11-281-0/+4
| | | Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
* gh-133228: c-analyzer clang preprocessor (GH-133229)dgpb2025-11-271-0/+4
| | | | | | * impl * included 2 failures to tsvs next to similar entries * added fix/hack for curses.h fails * fix leftover from debug
* gh-133059: Increase the small positive integer cache to 1024 (GH-133160)dgpb2025-09-241-2/+2
|
* gh-139109: Dynamic opcode targets (GH-139111)Ken Jin2025-09-181-0/+1
| | | | Make opcode targets table dynamic
* GH-92266: Remove embedded tabs from ``c-analyzer/cpython/_parser.py`` (#137622)Adam Turner2025-09-171-259/+243
|
* gh-128627: Use __builtin_wasm_test_function_pointer_signature for Emscripten ↵Hood Chatham2025-09-171-0/+1
| | | | | | | trampoline (#137470) With https://github.com/llvm/llvm-project/pull/150201 being merged, there is now a better way to generate the Emscripten trampoline, instead of including hand-generated binary WASM content. Requires Emscripten 4.0.12.
* gh-133158: Adjust c-analyzer `max_sizes` for `typeobject.c` (GH-133159)Sergey Miryanov2025-09-021-1/+1
| | | This also improves the error message for when a file is too large.
* Exclude _testclinic_depr.c.h from c-analyzer (GH-137086)Zachary Ware2025-07-241-0/+2
| | | | | | | | | _testclinic.c mocks out PY_VERSION_HEX to 3.8 before including _testclinic_depr.c.h to avoid the errors the preprocessor would otherwise throw due to the deprecation feature it is testing. Also partially revert 74e2acddf68b31ce16e8e0067b1df8c7b67bd6c8: this restores Modules/_testclinic.c to match the same file in the 3.14 branch.
* gh-127146: Report uid in Emscripten + node as native uid (#136509)Hood Chatham2025-07-161-0/+1
| | | | Corrects the handling of getuid on emscripten, which was consistently reporting as 0.
* gh-99108: Implement HACL* HMAC (#130157)Bénédikt Tran2025-04-041-0/+1
| | | | | | | A new extension module, `_hmac`, now exposes the HACL* HMAC (formally verified) implementation. The HACL* implementation is used as a fallback implementation when the OpenSSL implementation of HMAC is not available or disabled. For now, only named hash algorithms are recognized and SIMD support provided by HACL* for the BLAKE2 hash functions is not yet used.
* gh-127330: Update for OpenSSL 3.4 & document+improve the update process ↵Petr Viktorin2024-11-281-3/+1
| | | | | | | | | | | | | | | | | (GH-127331) - Add `git describe` output to headers generated by `make_ssl_data.py` This info is more important than the date when the file was generated. It does mean that the tool now requires a Git checkout of OpenSSL, not for example a release tarball. - Regenerate the older file to add the info. To the other older file, add a note about manual edits. - Add notes on how to add a new OpenSSL version - Add 3.4 error messages and multissl tests
* gh-76785: Minor Cleanup of "Cross-interpreter" Code (gh-126457)Eric Snow2024-11-071-0/+1
| | | | | | | | The primary objective here is to allow some later changes to be cleaner. Mostly this involves renaming things and moving a few things around. * CrossInterpreterData -> XIData * crossinterpdatafunc -> xidatafunc * split out pycore_crossinterp_data_registry.h * add _PyXIData_lookup_t
* gh-107954, PEP 741: Add PyConfig_Get()/Set() functions (#123472)Victor Stinner2024-09-021-0/+1
| | | | | | | | | | | Add PyConfig_Get(), PyConfig_GetInt(), PyConfig_Set() and PyConfig_Names() functions to get and set the current runtime Python configuration. Add visibility and "sys spec" to config and preconfig specifications. _PyConfig_AsDict() now converts PyConfig.xoptions as a dictionary. Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* gh-99108: Add HACL* Blake2 implementation to hashlib (GH-119316)Jonathan Protzenko2024-08-131-0/+3
| | | | | | | This replaces the existing hashlib Blake2 module with a single implementation that uses HACL\*'s Blake2b/Blake2s implementations. We added support for all the modes exposed by the Python API, including tree hashing, leaf nodes, and so on. We ported and merged all of these changes upstream in HACL\*, added test vectors based on Python's existing implementation, and exposed everything needed for hashlib. This was joint work done with @R1kM. See the PR for much discussion and benchmarking details. TL;DR: On many systems, 8-50% faster (!) than `libb2`, on some systems it appeared 10-20% slower than `libb2`.
* gh-119396: Optimize unicode_repr() (#119617)Victor Stinner2024-05-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | Use stringlib to specialize unicode_repr() for each string kind (UCS1, UCS2, UCS4). Benchmark: +-------------------------------------+---------+----------------------+ | Benchmark | ref | change2 | +=====================================+=========+======================+ | repr('abc') | 100 ns | 103 ns: 1.02x slower | +-------------------------------------+---------+----------------------+ | repr('a' * 100) | 369 ns | 369 ns: 1.00x slower | +-------------------------------------+---------+----------------------+ | repr(('a' + squote) * 100) | 1.21 us | 946 ns: 1.27x faster | +-------------------------------------+---------+----------------------+ | repr(('a' + nl) * 100) | 1.23 us | 907 ns: 1.36x faster | +-------------------------------------+---------+----------------------+ | repr(dquote + ('a' + squote) * 100) | 1.08 us | 858 ns: 1.25x faster | +-------------------------------------+---------+----------------------+ | Geometric mean | (ref) | 1.16x faster | +-------------------------------------+---------+----------------------+
* Rename tier 2 redundancy eliminator to optimizer (#115888)Guido van Rossum2024-02-261-2/+2
| | | | The original name is just too much of a mouthful.
* GH-112354: Initial implementation of warm up on exits and trace-stitching ↵Mark Shannon2024-02-201-0/+1
| | | | (GH-114142)
* gh-115399: Upgrade bundled libexpat to 2.6.0 (#115431)Seth Michael Larson2024-02-141-0/+1
|
* gh-114058: Foundations of the Tier2 redundancy eliminator (GH-115085)Ken Jin2024-02-131-0/+2
| | | | | | | --------- Co-authored-by: Mark Shannon <9448417+markshannon@users.noreply.github.com> Co-authored-by: Jules <57632293+JuliaPoo@users.noreply.github.com> Co-authored-by: Guido van Rossum <gvanrossum@users.noreply.github.com>
* gh-89532: Remove LibreSSL workarounds (#28728)Rami2024-01-061-2/+1
| | | | | | Remove LibreSSL specific workaround ifdefs from `_ssl.c` and delete the non-version-specific `_ssl_data.h` file (relevant for OpenSSL < 1.1.1, which we no longer support per PEP 644). Co-authored-by: Christian Heimes <christian@python.org> Co-authored-by: Gregory P. Smith <greg@krypto.org>
* GH-111485: Delete the old generator code. (GH-113321)Mark Shannon2023-12-211-1/+0
|
* gh-90815: Add mimalloc memory allocator (#109914)Dino Viehland2023-10-301-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add mimalloc v2.12 Modified src/alloc.c to remove include of alloc-override.c and not compile new handler. Did not include the following files: - include/mimalloc-new-delete.h - include/mimalloc-override.h - src/alloc-override-osx.c - src/alloc-override.c - src/static.c - src/region.c mimalloc is thread safe and shares a single heap across all runtimes, therefore finalization and getting global allocated blocks across all runtimes is different. * mimalloc: minimal changes for use in Python: - remove debug spam for freeing large allocations - use same bytes (0xDD) for freed allocations in CPython and mimalloc This is important for the test_capi debug memory tests * Don't export mimalloc symbol in libpython. * Enable mimalloc as Python allocator option. * Add mimalloc MIT license. * Log mimalloc in Lib/test/pythoninfo.py. * Document new mimalloc support. * Use macro defs for exports as done in: https://github.com/python/cpython/pull/31164/ Co-authored-by: Sam Gross <colesbury@gmail.com> Co-authored-by: Christian Heimes <christian@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-108724: Add PyMutex and _PyParkingLot APIs (gh-109344)Sam Gross2023-09-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | PyMutex is a one byte lock with fast, inlineable lock and unlock functions for the common uncontended case. The design is based on WebKit's WTF::Lock. PyMutex is built using the _PyParkingLot APIs, which provides a cross-platform futex-like API (based on WebKit's WTF::ParkingLot). This internal API will be used for building other synchronization primitives used to implement PEP 703, such as one-time initialization and events. This also includes tests and a mini benchmark in Tools/lockbench/lockbench.py to compare with the existing PyThread_type_lock. Uncontended acquisition + release: * Linux (x86-64): PyMutex: 11 ns, PyThread_type_lock: 44 ns * macOS (arm64): PyMutex: 13 ns, PyThread_type_lock: 18 ns * Windows (x86-64): PyMutex: 13 ns, PyThread_type_lock: 38 ns PR Overview: The primary purpose of this PR is to implement PyMutex, but there are a number of support pieces (described below). * PyMutex: A 1-byte lock that doesn't require memory allocation to initialize and is generally faster than the existing PyThread_type_lock. The API is internal only for now. * _PyParking_Lot: A futex-like API based on the API of the same name in WebKit. Used to implement PyMutex. * _PyRawMutex: A word sized lock used to implement _PyParking_Lot. * PyEvent: A one time event. This was used a bunch in the "nogil" fork and is useful for testing the PyMutex implementation, so I've included it as part of the PR. * pycore_llist.h: Defines common operations on doubly-linked list. Not strictly necessary (could do the list operations manually), but they come up frequently in the "nogil" fork. ( Similar to https://man.freebsd.org/cgi/man.cgi?queue) --------- Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* gh-107557: Setup abstract interpretation (#107847)Ken Jin2023-08-151-0/+1
| | | | Co-authored-by: Guido van Rossum <gvanrossum@users.noreply.github.com> Co-authored-by: Jules <57632293+juliapoo@users.noreply.github.com>
* gh-101524: Only Use Public C-API in the _xxsubinterpreters Module (gh-107359)Eric Snow2023-07-271-0/+1
| | | The _xxsubinterpreters module should not rely on internal API. Some of the functions it uses were recently moved there however. Here we move them back (and expose them properly).
* gh-106320: Remove private _PyInterpreterID C API (#107053)Victor Stinner2023-07-221-1/+0
| | | | | | | Move the private _PyInterpreterID C API to the internal C API: add a new pycore_interp_id.h header file. Remove Include/interpreteridobject.h and Include/cpython/interpreteridobject.h header files.
* gh-104584: Baby steps towards generating and executing traces (#105924)Guido van Rossum2023-06-271-0/+1
| | | | | Added a new, experimental, tracing optimizer and interpreter (a.k.a. "tier 2"). This currently pessimizes, so don't use yet -- this is infrastructure so we can experiment with optimizing passes. To enable it, pass ``-Xuops`` or set ``PYTHONUOPS=1``. To get debug output, set ``PYTHONUOPSDEBUG=N`` where ``N`` is a debug level (0-4, where 0 is no debug output and 4 is excessively verbose). All of this code is likely to change dramatically before the 3.13 feature freeze. But this is a first step.
* gh-101524: Only Use Public C-API in the _xxsubinterpreters Module (gh-105258)Eric Snow2023-06-021-0/+1
| | | The _xxsubinterpreters module was meant to only use public API. Some internal C-API usage snuck in over the last few years (e.g. gh-28969). This fixes that.
* gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (#105174)Gregory P. Smith2023-06-011-0/+1
| | | | | | | | | | | | | Upgrade builds to OpenSSL 1.1.1u. This OpenSSL version addresses a pile if less-urgent CVEs since 1.1.1t. The Mac/BuildScript/build-installer.py was already updated. Also updates _ssl_data_111.h from OpenSSL 1.1.1u, _ssl_data_300.h from 3.0.9, and adds a new _ssl_data_31.h file from 3.1.1 along with the ssl.c code to use it. Manual edits to the _ssl_data_300.h file prevent it from removing any existing definitions in case those exist in some peoples builds and were important (avoiding regressions during backporting). backports of this prior to 3.12 will not include the openssl 3.1 header.
* gh-104773: PEP 594: Remove the nis module (#104897)Victor Stinner2023-05-241-1/+0
|
* gh-99108: Replace SHA3 implementation HACL* version (#103597)Jonathan Protzenko2023-05-081-7/+1
| | | | | | | | | | | Replaces our built-in SHA3 implementation with a verified one from the HACL* project. This implementation is used when OpenSSL does not provide SHA3 or is not present. 3.11 shiped with a very slow tiny sha3 implementation to get off of the <=3.10 reference implementation that wound up having serious bugs. This brings us back to a reasonably performing built-in implementation consistent with what we've just replaced our other guaranteed available standard hash algorithms with: code from the HACL* project. --------- Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-103326: Remove `Python/importlib.h` (GH-103331)Nikita Sobolev2023-04-121-1/+0
| | | | Co-authored-by: Brett Cannon <brett@python.org> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* gh-103334: Ignore `Tools/c-analyzer/cpython/_parser.py` from `patchcheck` ↵Nikita Sobolev2023-04-101-0/+1
| | | | | | | (GH-103335) I've also added a small comment to `Tools/c-analyzer/cpython/_parser.py` to trigger the `patchcheck` CI. It must pass now. Automerge-Triggered-By: GH:ericsnowcurrently
* gh-102737: Un-ignore ceval.c in the CI globals check (gh-102745)Eric Snow2023-03-161-4/+0
| | | | | The tool now allows user-added #LINE preprocessor directives. https://github.com/python/cpython/issues/102737
* Exclude `ceval.c` from the C-analyzer tool (#102735)Alex Waygood2023-03-151-0/+5
| | | | | | | | | | The "check if generated files are up to date" CI check appears to be currently failing on all PRs (but not on pushes to main) See, for example: - https://github.com/python/cpython/pull/94468 - https://github.com/python/cpython/pull/94468 - https://github.com/python/cpython/pull/102731 This appears to be because the C-analyzer tool doesn't like the `#line` directives introduced in https://github.com/python/cpython/commit/70185de1abfe428049a5c43d58fcb656b46db96c. I'm advised by the message printed to the terminal in https://github.com/python/cpython/actions/runs/4428706945/jobs/7768216988#step:14:84 that this is the appropriate short-term fix!
* gh-81057: Add a CI Check for New Unsupported C Global Variables (gh-102506)Eric Snow2023-03-141-2/+7
| | | | | | | | | | | This will keep us from adding new unsupported (i.e. non-const) C global variables, which would break interpreter isolation. FYI, historically it is very uncommon for new global variables to get added. Furthermore, it is rare for new code to break the c-analyzer. So the check should almost always pass unnoticed. Note that I've removed test_check_c_globals. A test wasn't a great fit conceptually and was super slow on debug builds. A CI check is a better fit. This also resolves gh-100237. https://github.com/python/cpython/issues/81057
* gh-90110: Fix the c-analyzer Tool (#102483)Eric Snow2023-03-071-1/+8
| | | | | | | Some incompatible changes had gone in, and the "ignore" lists weren't properly undated. This change fixes that. It's necessary prior to enabling test_check_c_globals, which I hope to do soon. Note that this does include moving last_resort_memory_error to PyInterpreterState. https://github.com/python/cpython/issues/90110
* gh-100540: Remove obsolete Modules/_ctypes/darwin/ dlfcn shim (GH-100541)Zachary Ware2022-12-291-1/+0
| | | As far as I can tell, this hasn't been actually used since Mac OS X 10.2.
* gh-100540: Remove unused Modules/_ctypes/libffi_osx/ (GH-100543)Zachary Ware2022-12-281-1/+0
| | | | It was an ancient, modified copy of libffi that has not been in use since GH-22855.
* gh-90110: Update the C-analyzer Tool (gh-99307)Eric Snow2022-11-101-0/+6
|
* gh-90110: Fix the c-analyzer Tool (gh-96731)Eric Snow2022-09-121-76/+98
| | | | | | | This includes: * update the whitelists * fixes so we can stop ignoring some of the files * ensure Include/cpython/*.h get analyzed
* GH-96177: Move GIL and eval breaker code out of ceval.c into ceval_gil.c. ↵Mark Shannon2022-08-241-1/+0
| | | | (GH-96204)
* gh-90110: Update the c-analyzer Tool (gh-96058)Eric Snow2022-08-171-4/+4
|
* gh-90110: Get the C Analyzer Tool Working Again (gh-96057)Eric Snow2022-08-171-0/+5
| | | | | | | | We broke it with a recent `_PyArg_Parser` change. Also: * moved the `_PyArg_Parser` whitelist entries over to ignored.tsv now that they are thread-safe * added some known globals from a currently-excluded file * dropped some outdated globals from the whitelist
* gh-90110: Get the C Analyzer Tool Working Again (gh-95545)Eric Snow2022-08-011-0/+3
|
* gh-81057: Get the c-analyzer tool working again. (gh-92246)Eric Snow2022-05-031-2/+5
|
* bpo-47152: Move sources of the _sre module into a subdirectory (GH-32290)Serhiy Storchaka2022-04-041-3/+3
|
* bpo-36876: Make sure the c-analyzer is checking all the source files.' ↵Eric Snow2022-02-101-1/+7
| | | | | (gh-31264) https://bugs.python.org/issue36876
* bpo-45952: Get the C analyzer tool working again. (gh-31220)Eric Snow2022-02-081-0/+1
| | | https://bugs.python.org/issue45952
* bpo-45952: Get the C analyzer tool working again. (gh-31219)Eric Snow2022-02-081-0/+3
| | | https://bugs.python.org/issue45952