Skip to content

Commit 73679b1

Browse files
gh-90110: Update the C-analyzer Tool (gh-99307)
1 parent 6dedf42 commit 73679b1

File tree

4 files changed

+14
-90
lines changed

4 files changed

+14
-90
lines changed

Modules/zlibmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1718,7 +1718,7 @@ ZlibDecompressor__new__(PyTypeObject *cls,
17181718
PyObject *kwargs)
17191719
{
17201720
static char *keywords[] = {"wbits", "zdict", NULL};
1721-
static char *format = "|iO:_ZlibDecompressor";
1721+
static const char * const format = "|iO:_ZlibDecompressor";
17221722
int wbits = MAX_WBITS;
17231723
PyObject *zdict = NULL;
17241724
zlibstate *state = PyType_GetModuleState(cls);

Tools/c-analyzer/cpython/_parser.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ def clean_lines(text):
8282
# generated
8383
Python/deepfreeze/*.c
8484
Python/frozen_modules/*.h
85+
Python/generated_cases.c.h
86+
87+
# not actually source
88+
Python/bytecodes.c
8589
8690
# @end=conf@
8791
''')
@@ -285,6 +289,7 @@ def clean_lines(text):
285289

286290
SAME = {
287291
_abs('Include/*.h'): [_abs('Include/cpython/')],
292+
_abs('Python/ceval.c'): ['Python/generated_cases.c.h'],
288293
}
289294

290295
MAX_SIZES = {
@@ -311,6 +316,7 @@ def clean_lines(text):
311316
_abs('Python/frozen_modules/*.h'): (20_000, 500),
312317
_abs('Python/opcode_targets.h'): (10_000, 500),
313318
_abs('Python/stdlib_module_names.h'): (5_000, 500),
319+
_abs('Python/importlib.h'): (200_000, 5000),
314320

315321
# These large files are currently ignored (see above).
316322
_abs('Modules/_ssl_data.h'): (80_000, 10_000),

Tools/c-analyzer/cpython/globals-to-fix.tsv

Lines changed: 2 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -304,20 +304,14 @@ Objects/sliceobject.c - _Py_EllipsisObject -
304304
# manually cached PyUnicodeObject
305305
Python/ast_unparse.c - _str_replace_inf -
306306

307-
# holds statically-initialized strings
308-
Objects/typeobject.c - slotdefs -
309-
310307
# other
311308
Objects/typeobject.c object___reduce_ex___impl objreduce -
312-
Objects/unicodeobject.c - _string_module -
313-
Objects/unicodeobject.c - interned -
314309

315310
#-----------------------
316311
# other
317312

318313
# initialized once
319314
Python/context.c - _token_missing -
320-
Python/fileutils.c - _Py_open_cloexec_works -
321315
Python/hamt.c - _empty_bitmap_node -
322316
Python/hamt.c - _empty_hamt -
323317

@@ -384,6 +378,7 @@ Python/perf_trampoline.c - perf_map_file -
384378
Objects/unicodeobject.c - ucnhash_capi -
385379
Parser/action_helpers.c _PyPegen_dummy_name cache -
386380
Python/dtoa.c - p5s -
381+
Python/fileutils.c - _Py_open_cloexec_works -
387382
Python/fileutils.c - force_ascii -
388383
Python/fileutils.c set_inheritable ioctl_works -
389384
Python/import.c - import_lock -
@@ -511,6 +506,7 @@ Modules/_testcapi/vectorcall.c - MethodDescriptorNopGet_Type -
511506
Modules/_testcapi/vectorcall.c - MethodDescriptor2_Type -
512507
Modules/itertoolsmodule.c - _grouper_type -
513508
Modules/itertoolsmodule.c - accumulate_type -
509+
Modules/itertoolsmodule.c - batched_type -
514510
Modules/itertoolsmodule.c - chain_type -
515511
Modules/itertoolsmodule.c - combinations_type -
516512
Modules/itertoolsmodule.c - compress_type -
@@ -701,89 +697,6 @@ Modules/xxmodule.c - ErrorObject -
701697
#-----------------------
702698
# cached - initialized once
703699

704-
# _Py_IDENTIFIER (global)
705-
Modules/_asynciomodule.c - PyId___asyncio_running_event_loop__ -
706-
Modules/_asynciomodule.c - PyId__asyncio_future_blocking -
707-
Modules/_asynciomodule.c - PyId_add_done_callback -
708-
Modules/_asynciomodule.c - PyId_call_soon -
709-
Modules/_asynciomodule.c - PyId_cancel -
710-
Modules/_asynciomodule.c - PyId_get_event_loop -
711-
Modules/_asynciomodule.c - PyId_throw -
712-
Modules/_datetimemodule.c - PyId_as_integer_ratio -
713-
Modules/_datetimemodule.c - PyId_fromutc -
714-
Modules/_datetimemodule.c - PyId_isoformat -
715-
Modules/_datetimemodule.c - PyId_strftime -
716-
717-
# _Py_IDENTIFIER (local)
718-
Modules/_asynciomodule.c FutureObj_finalize PyId_call_exception_handler -
719-
Modules/_asynciomodule.c FutureObj_finalize PyId_exception -
720-
Modules/_asynciomodule.c FutureObj_finalize PyId_future -
721-
Modules/_asynciomodule.c FutureObj_finalize PyId_message -
722-
Modules/_asynciomodule.c FutureObj_finalize PyId_source_traceback -
723-
Modules/_asynciomodule.c FutureObj_get_state PyId_CANCELLED -
724-
Modules/_asynciomodule.c FutureObj_get_state PyId_FINISHED -
725-
Modules/_asynciomodule.c FutureObj_get_state PyId_PENDING -
726-
Modules/_asynciomodule.c TaskObj_finalize PyId_call_exception_handler -
727-
Modules/_asynciomodule.c TaskObj_finalize PyId_message -
728-
Modules/_asynciomodule.c TaskObj_finalize PyId_source_traceback -
729-
Modules/_asynciomodule.c TaskObj_finalize PyId_task -
730-
Modules/_asynciomodule.c future_init PyId_get_debug -
731-
Modules/_asynciomodule.c get_future_loop PyId__loop -
732-
Modules/_asynciomodule.c get_future_loop PyId_get_loop -
733-
Modules/_asynciomodule.c register_task PyId_add -
734-
Modules/_asynciomodule.c unregister_task PyId_discard -
735-
Modules/_ctypes/_ctypes.c CDataType_from_param PyId__as_parameter_ -
736-
Modules/_ctypes/_ctypes.c PyCArrayType_new PyId__length_ -
737-
Modules/_ctypes/_ctypes.c PyCArrayType_new PyId__type_ -
738-
Modules/_ctypes/_ctypes.c PyCFuncPtr_set_restype PyId__check_retval_ -
739-
Modules/_ctypes/_ctypes.c PyCPointerType_new PyId__type_ -
740-
Modules/_ctypes/_ctypes.c PyCPointerType_set_type PyId__type_ -
741-
Modules/_ctypes/_ctypes.c PyCSimpleType_from_param PyId__as_parameter_ -
742-
Modules/_ctypes/_ctypes.c PyCSimpleType_new PyId__type_ -
743-
Modules/_ctypes/_ctypes.c StructUnionType_new PyId__abstract_ -
744-
Modules/_ctypes/_ctypes.c StructUnionType_new PyId__fields_ -
745-
Modules/_ctypes/_ctypes.c _build_result PyId___ctypes_from_outparam__ -
746-
Modules/_ctypes/_ctypes.c _init_pos_args PyId__fields_ -
747-
Modules/_ctypes/_ctypes.c c_char_p_from_param PyId__as_parameter_ -
748-
Modules/_ctypes/_ctypes.c c_void_p_from_param PyId__as_parameter_ -
749-
Modules/_ctypes/_ctypes.c c_wchar_p_from_param PyId__as_parameter_ -
750-
Modules/_ctypes/_ctypes.c converters_from_argtypes PyId_from_param -
751-
Modules/_ctypes/_ctypes.c make_funcptrtype_dict PyId__argtypes_ -
752-
Modules/_ctypes/_ctypes.c make_funcptrtype_dict PyId__check_retval_ -
753-
Modules/_ctypes/_ctypes.c make_funcptrtype_dict PyId__flags_ -
754-
Modules/_ctypes/_ctypes.c make_funcptrtype_dict PyId__restype_ -
755-
Modules/_ctypes/callproc.c ConvParam PyId__as_parameter_ -
756-
Modules/_ctypes/callproc.c unpickle PyId___new__ -
757-
Modules/_ctypes/callproc.c unpickle PyId___setstate__ -
758-
Modules/_ctypes/stgdict.c MakeAnonFields PyId__anonymous_ -
759-
Modules/_ctypes/stgdict.c PyCStructUnionType_update_stgdict PyId__pack_ -
760-
Modules/_ctypes/stgdict.c PyCStructUnionType_update_stgdict PyId__swappedbytes_ -
761-
Modules/_ctypes/stgdict.c PyCStructUnionType_update_stgdict PyId__use_broken_old_ctypes_structure_semantics_ -
762-
Modules/_cursesmodule.c _curses_getwin PyId_read -
763-
Modules/_cursesmodule.c _curses_window_putwin PyId_write -
764-
Modules/_cursesmodule.c update_lines_cols PyId_COLS -
765-
Modules/_cursesmodule.c update_lines_cols PyId_LINES -
766-
Modules/_datetimemodule.c call_tzname PyId_tzname -
767-
Modules/_datetimemodule.c date_strftime PyId_timetuple -
768-
Modules/_datetimemodule.c date_today PyId_fromtimestamp -
769-
Modules/_datetimemodule.c datetime_strptime PyId__strptime_datetime -
770-
Modules/_datetimemodule.c make_Zreplacement PyId_replace -
771-
Modules/_datetimemodule.c tzinfo_reduce PyId___getinitargs__ -
772-
Modules/_elementtree.c _elementtree_Element_find_impl PyId_find -
773-
Modules/_elementtree.c _elementtree_Element_findall_impl PyId_findall -
774-
Modules/_elementtree.c _elementtree_Element_findtext_impl PyId_findtext -
775-
Modules/_elementtree.c _elementtree_Element_iterfind_impl PyId_iterfind -
776-
Modules/_elementtree.c expat_start_doctype_handler PyId_doctype -
777-
Modules/_elementtree.c treebuilder_add_subelement PyId_append -
778-
Modules/_elementtree.c treebuilder_flush_data PyId_tail -
779-
Modules/_elementtree.c treebuilder_flush_data PyId_text -
780-
Modules/_json.c _encoded_const PyId_false -
781-
Modules/_json.c _encoded_const PyId_null -
782-
Modules/_json.c _encoded_const PyId_true -
783-
Modules/_json.c raise_errmsg PyId_JSONDecodeError -
784-
Modules/_json.c raise_errmsg PyId_decoder -
785-
Modules/ossaudiodev.c oss_exit PyId_close -
786-
787700
# manually cached PyUnicodeOjbect
788701
Modules/_asynciomodule.c - context_kwname -
789702
Modules/_ctypes/callproc.c _ctypes_get_errobj error_object_name -

Tools/c-analyzer/cpython/ignored.tsv

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,10 @@ Modules/_testcapimodule.c test_capsule buffer -
261261
Modules/_testcapimodule.c test_empty_argparse kwlist -
262262
Modules/_testcapimodule.c test_structmembers_new keywords -
263263
Modules/_testcapimodule.c getargs_s_hash_int keywords -
264+
Modules/_testcapimodule.c - g_dict_watch_events -
265+
Modules/_testcapimodule.c - g_dict_watchers_installed -
266+
Modules/_testcapimodule.c - g_type_modified_events -
267+
Modules/_testcapimodule.c - g_type_watchers_installed -
264268
Modules/_testimportmultiple.c - _barmodule -
265269
Modules/_testimportmultiple.c - _foomodule -
266270
Modules/_testimportmultiple.c - _testimportmultiple -
@@ -467,6 +471,7 @@ Objects/obmalloc.c - _PyObject -
467471
Objects/obmalloc.c - usedpools -
468472
Python/perf_trampoline.c - _Py_perfmap_callbacks -
469473
Objects/typeobject.c - name_op -
474+
Objects/typeobject.c - slotdefs -
470475
Objects/unicodeobject.c - stripfuncnames -
471476
Objects/unicodeobject.c - utf7_category -
472477
Objects/unicodeobject.c unicode_decode_call_errorhandler_wchar argparse -

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy