Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add known globals.
  • Loading branch information
ericsnowcurrently committed Aug 1, 2022
commit af840a2440524cf3e84c698ec1a63b328e3e3146
28 changes: 26 additions & 2 deletions Tools/c-analyzer/cpython/globals-to-fix.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Objects/genericaliasobject.c - _Py_GenericAliasIterType -
Objects/iterobject.c - _PyAnextAwaitable_Type -
# Not in a .h file:
Objects/memoryobject.c - _PyMemoryIter_Type -
#Objects/unicodeobject.c - _PyUnicodeASCIIIter_Type -
Objects/unicodeobject.c - _PyUnicodeASCIIIter_Type -
Objects/unionobject.c - _PyUnion_Type -
Python/context.c - _PyContextTokenMissing_Type -
Python/hamt.c - _PyHamtItems_Type -
Expand Down Expand Up @@ -349,7 +349,10 @@ Objects/clinic/unicodeobject.c.h unicode_split _parser -
Objects/clinic/unicodeobject.c.h unicode_splitlines _parser -
Python/clinic/Python-tokenize.c.h tokenizeriter_new _parser -
Python/clinic/_warnings.c.h warnings_warn _parser -
Python/clinic/_warnings.c.h warnings_warn_explicit _parser -
Python/clinic/bltinmodule.c.h builtin___import__ _parser -
Python/clinic/bltinmodule.c.h builtin_compile _parser -
Python/clinic/bltinmodule.c.h builtin_exec _parser -
Python/clinic/bltinmodule.c.h builtin_pow _parser -
Python/clinic/bltinmodule.c.h builtin_print _parser -
Python/clinic/bltinmodule.c.h builtin_round _parser -
Expand Down Expand Up @@ -511,6 +514,8 @@ Python/bootstrap_hash.c - urandom_cache -
Python/ceval.c - lltrace -
# XXX This should have been found by the analyzer but wasn't:
Python/ceval.c make_pending_calls busy -
Python/ceval.c _PyEval_SetProfile reentrant -
Python/ceval.c _PyEval_SetTrace reentrant -
Python/dynload_shlib.c - handles -
Python/dynload_shlib.c - nhandles -
# XXX This should have been found by the analyzer but wasn't:
Expand Down Expand Up @@ -587,6 +592,10 @@ Modules/_io/textio.c - PyIncrementalNewlineDecoder_Type -
Modules/_io/textio.c - PyTextIOBase_Type -
Modules/_io/textio.c - PyTextIOWrapper_Type -
Modules/_io/winconsoleio.c - PyWindowsConsoleIO_Type -
Modules/_testcapi/vectorcall.c - MethodDescriptorBase_Type -
Modules/_testcapi/vectorcall.c - MethodDescriptorDerived_Type -
Modules/_testcapi/vectorcall.c - MethodDescriptorNopGet_Type -
Modules/_testcapi/vectorcall.c - MethodDescriptor2_Type -
Modules/_threadmodule.c - Locktype -
Modules/_threadmodule.c - RLocktype -
Modules/_threadmodule.c - localdummytype -
Expand Down Expand Up @@ -629,6 +638,10 @@ Modules/signalmodule.c - ItimerError -
# cached - initialized once

# _PyArg_Parser
Modules/clinic/_asynciomodule.c.h _asyncio_Task__check_future _parser -
Modules/clinic/_csv.c.h _csv_unregister_dialect _parser -
Modules/clinic/_csv.c.h _csv_get_dialect _parser -
Modules/clinic/_csv.c.h _csv_field_size_limit _parser -
Modules/clinic/_codecsmodule.c.h _codecs_decode _parser -
Modules/clinic/_codecsmodule.c.h _codecs_encode _parser -
Modules/clinic/_sre.c.h _sre_SRE_Match_expand _parser -
Expand All @@ -646,6 +659,10 @@ Modules/clinic/_sre.c.h _sre_SRE_Pattern_subn _parser -
Modules/clinic/_sre.c.h _sre_SRE_Scanner_match _parser -
Modules/clinic/_sre.c.h _sre_SRE_Scanner_search _parser -
Modules/clinic/_sre.c.h _sre_compile _parser -
Modules/clinic/_winapi.c.h _winapi_LCMapStringEx _parser -
Modules/clinic/arraymodule.c.h array_array_fromfile _parser -
Modules/clinic/arraymodule.c.h array_array_tofile _parser -
Modules/clinic/arraymodule.c.h array_array___reduce_ex__ _parser -
Modules/clinic/gcmodule.c.h gc_collect _parser -
Modules/clinic/gcmodule.c.h gc_get_objects _parser -
Modules/clinic/itertoolsmodule.c.h itertools_accumulate _parser -
Expand Down Expand Up @@ -681,6 +698,7 @@ Modules/clinic/posixmodule.c.h os_scandir _parser -
Modules/clinic/posixmodule.c.h os_stat _parser -
Modules/clinic/posixmodule.c.h os_unlink _parser -
Modules/clinic/posixmodule.c.h os_utime _parser -
Modules/clinic/socketmodule.c.h sock_initobj _parser -

#-----------------------
# other
Expand Down Expand Up @@ -942,6 +960,7 @@ Modules/xxmodule.c - ErrorObject -
# _Py_IDENTIFIER (global)
Modules/_asynciomodule.c - PyId___asyncio_running_event_loop__ -
Modules/_asynciomodule.c - PyId__asyncio_future_blocking -
Modules/_asynciomodule.c - PyId__check_future static -
Modules/_asynciomodule.c - PyId_add_done_callback -
Modules/_asynciomodule.c - PyId_call_soon -
Modules/_asynciomodule.c - PyId_cancel -
Expand Down Expand Up @@ -1256,11 +1275,13 @@ Modules/clinic/zlibmodule.c.h zlib_decompressobj _parser -
# other - during module init
Modules/_asynciomodule.c - asyncio_mod -
Modules/_asynciomodule.c - traceback_extract_stack -
Modules/_asynciomodule.c - asyncio_get_event_loop_policy -
Modules/_asynciomodule.c - asyncio_future_repr_func -
Modules/_asynciomodule.c - asyncio_future_repr_info_func -
Modules/_asynciomodule.c - asyncio_get_event_loop_policy -
Modules/_asynciomodule.c - asyncio_iscoroutine_func -
Modules/_asynciomodule.c - asyncio_task_get_stack_func -
Modules/_asynciomodule.c - asyncio_task_print_stack_func -
Modules/_asynciomodule.c - asyncio_task_repr_func -
Modules/_asynciomodule.c - asyncio_task_repr_info_func -
Modules/_asynciomodule.c - asyncio_InvalidStateError -
Modules/_asynciomodule.c - asyncio_CancelledError -
Expand Down Expand Up @@ -1303,6 +1324,7 @@ Modules/_ssl.c - lib_codes_to_names -
Modules/_ssl.c - _ssl_locks -
Modules/_struct.c - cache -
Modules/arraymodule.c array_array___reduce_ex__ array_reconstructor -
Modules/arraymodule.c array_array___reduce_ex___impl array_reconstructor -
Modules/cjkcodecs/cjkcodecs.h getmultibytecodec cofunc -

# state
Expand All @@ -1313,6 +1335,7 @@ Modules/_asynciomodule.c - all_tasks -
Modules/_asynciomodule.c - current_tasks -
Modules/_asynciomodule.c - iscoroutine_typecache -
Modules/_ctypes/_ctypes.c - _ctypes_ptrtype_cache -
Modules/_testinternalcapi.c - record_list -
Modules/_tkinter.c - tcl_lock -
Modules/_tkinter.c - excInCmd -
Modules/_tkinter.c - valInCmd -
Expand Down Expand Up @@ -1401,3 +1424,4 @@ Modules/rotatingtree.c - random_stream -
Modules/rotatingtree.c - random_value -
Modules/socketmodule.c - defaulttimeout -
Modules/syslogmodule.c - S_log_open -
Modules/clinic/_asynciomodule.c.h _asyncio_Task__check_future _parser -
85 changes: 84 additions & 1 deletion Tools/c-analyzer/cpython/ignored.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ Modules/_sqlite/module.c - pysqlite_BaseTypeAdapted -
Modules/_sqlite/module.h - pysqlite_global_state -
Modules/_testcapimodule.c - _PyBytesIOBuffer_Type -
Modules/posixmodule.c - _Py_open_cloexec_works -
Objects/object.c - _Py_GenericAliasIterType -
Objects/object.c - _PyMemoryIter_Type -
Objects/object.c - _PyLineIterator -
Objects/object.c - _PyPositionsIterator -
Python/importdl.h - _PyImport_DynLoadFiletab -


Expand Down Expand Up @@ -186,6 +190,7 @@ Modules/_testcapimodule.c - x -
Modules/_testcapimodule.c getargs_keyword_only keywords -
Modules/_testcapimodule.c getargs_keywords keywords -
Modules/_testcapimodule.c getargs_positional_only_and_keywords keywords -
Modules/_testcapimodule.c getargs_s_hash_int2 keywords static char*[]
Modules/_testcapimodule.c make_exception_with_doc kwlist -
Modules/_testcapimodule.c raise_SIGINT_then_send_None PyId_send -
Modules/_testcapimodule.c slot_tp_del PyId___tp_del__ -
Expand Down Expand Up @@ -400,11 +405,12 @@ Python/sysmodule.c sys_set_asyncgen_hooks keywords -

#-----------------------
# PyModuleDef

Modules/_multiprocessing/posixshmem.c - _posixshmemmodule -
Modules/_sqlite/module.h - _sqlite3module -
Modules/_sre/sre.c - sremodule static struct -
Modules/_ssl.c - _sslmodule_def -
Modules/_ssl.h - _sslmodule_def -
Modules/_testcapi/heaptype.c - _testcapimodule static -
Modules/_testmultiphase.c - def_module_state_shared -
Modules/_threadmodule.c - thread_module -
Modules/_typingmodule.c - typingmodule -
Expand All @@ -422,6 +428,7 @@ Python/sysmodule.c - sysmodule -
# PyModuleDef_Slot

Modules/_abc.c - _abcmodule_slots -
Modules/_bisectmodule.c - bisect_slots -
Modules/_blake2/blake2module.c - _blake2_slots -
Modules/_bz2module.c - _bz2_slots -
Modules/_codecsmodule.c - _codecs_slots -
Expand All @@ -448,6 +455,7 @@ Modules/_scproxy.c - _scproxy_slots -
Modules/_sha3/sha3module.c - _sha3_slots -
Modules/_sqlite/module.c - module_slots -
Modules/_sre.c - sre_slots -
Modules/_sre/sre.c - sre_slots -
Modules/_ssl.c - sslmodule_slots -
Modules/_stat.c - stat_slots -
Modules/_statisticsmodule.c - _statisticsmodule_slots -
Expand Down Expand Up @@ -615,10 +623,15 @@ Modules/_randommodule.c - random_methods -
Modules/_scproxy.c - mod_methods -
Modules/_sha3/sha3module.c - SHA3_methods -
Modules/_sha3/sha3module.c - SHAKE_methods -
Modules/_sqlite/blob.c - blob_methods static PyMethodDef[]
Modules/_sqlite/connection.c - connection_methods -
Modules/_sqlite/cursor.c - cursor_methods -
Modules/_sqlite/module.c - module_methods -
Modules/_sqlite/row.c - row_methods -
Modules/_sre/sre.c - _functions -
Modules/_sre/sre.c - pattern_methods -
Modules/_sre/sre.c - match_methods -
Modules/_sre/sre.c - scanner_methods -
Modules/_sre.c - _functions -
Modules/_sre.c - match_methods -
Modules/_sre.c - pattern_methods -
Expand All @@ -633,6 +646,8 @@ Modules/_statisticsmodule.c - statistics_methods -
Modules/_struct.c - module_functions -
Modules/_struct.c - s_methods -
Modules/_struct.c - unpackiter_methods -
Modules/_testcapi/heaptype.c - TestMethods -
Modules/_testcapi/vectorcall.c - TestMethods -
Modules/_threadmodule.c - lock_methods -
Modules/_threadmodule.c - rlock_methods -
Modules/_threadmodule.c - thread_methods -
Expand Down Expand Up @@ -772,6 +787,7 @@ Objects/fileobject.c - stdprinter_methods -
Objects/floatobject.c - float_methods -
Objects/frameobject.c - frame_methods -
Objects/genericaliasobject.c - ga_methods -
Objects/genericaliasobject.c - ga_iter_methods -
Objects/genobject.c - async_gen_asend_methods -
Objects/genobject.c - async_gen_athrow_methods -
Objects/genobject.c - async_gen_methods -
Expand Down Expand Up @@ -862,15 +878,28 @@ Modules/_json.c - encoder_members -
Modules/_json.c - scanner_members -
Modules/_lzmamodule.c - Decompressor_members -
Modules/_multiprocessing/semaphore.c - semlock_members -
Modules/_operator.c - attrgetter_members -
Modules/_operator.c - itemgetter_members -
Modules/_pickle.c - Pickler_members -
Modules/_queuemodule.c - simplequeue_members -
Modules/_sqlite/blob.c - blob_members -
Modules/_sqlite/connection.c - connection_members -
Modules/_sqlite/cursor.c - cursor_members -
Modules/_sqlite/statement.c - stmt_members -
Modules/_sre/sre.c - match_members -
Modules/_sre/sre.c - pattern_members -
Modules/_sre/sre.c - scanner_members -
Modules/_sre.c - match_members -
Modules/_sre.c - pattern_members -
Modules/_sre.c - scanner_members -
Modules/_struct.c - s_members -
Modules/_testcapi/heaptype.c - heapctype_members -
Modules/_testcapi/heaptype.c - heapctypesetattr_members -
Modules/_testcapi/heaptype.c - heapctypesubclass_members -
Modules/_testcapi/heaptype.c - heapctypewithdict_members -
Modules/_testcapi/heaptype.c - heapctypewithnegativedict_members -
Modules/_testcapi/heaptype.c - heapctypewithweakref_members -
Modules/_testcapi/heaptype.c - members_to_repeat -
Modules/_threadmodule.c - local_dummy_type_members -
Modules/_threadmodule.c - local_type_members -
Modules/_threadmodule.c - lock_type_members -
Expand Down Expand Up @@ -1080,14 +1109,18 @@ Modules/_io/winconsoleio.c - winconsoleio_getsetlist -
Modules/_pickle.c - Pickler_getsets -
Modules/_pickle.c - Unpickler_getsets -
Modules/_sha3/sha3module.c - SHA3_getseters -
Modules/_sha3/sha3module.c - SHAKE_getseters -
Modules/_sqlite/connection.c - connection_getset -
Modules/_sre/sre.c - pattern_getset -
Modules/_sre/sre.c - match_getset -
Modules/_sre.c - match_getset -
Modules/_sre.c - pattern_getset -
Modules/_ssl.c - PySSLSession_getsetlist -
Modules/_ssl.c - context_getsetlist -
Modules/_ssl.c - memory_bio_getsetlist -
Modules/_ssl.c - ssl_getsetlist -
Modules/_struct.c - s_getsetlist -
Modules/_testcapi/heaptype.c - heapctypewithdict_getsetlist -
Modules/_tkinter.c - PyTclObject_getsetlist -
Modules/_xxsubinterpretersmodule.c - channelid_getsets -
Modules/arraymodule.c - array_getsets -
Expand Down Expand Up @@ -1172,6 +1205,7 @@ Modules/_json.c - PyScannerType_slots -
Modules/_lsprof.c - _lsprof_profiler_type_spec_slots -
Modules/_lzmamodule.c - lzma_compressor_type_slots -
Modules/_lzmamodule.c - lzma_decompressor_type_slots -
Modules/_multiprocessing/semaphore.c - _PyMp_SemLockType_slots -
Modules/_operator.c - attrgetter_type_slots -
Modules/_operator.c - itemgetter_type_slots -
Modules/_operator.c - methodcaller_type_slots -
Expand All @@ -1184,11 +1218,15 @@ Modules/_sha3/sha3module.c - sha3_256_slots -
Modules/_sha3/sha3module.c - sha3_384_slots -
Modules/_sha3/sha3module.c - sha3_512_slots -
Modules/_sha3/sha3module.c - type_slots_obj -
Modules/_sqlite/blob.c - blob_slots -
Modules/_sqlite/connection.c - connection_slots -
Modules/_sqlite/cursor.c - cursor_slots -
Modules/_sqlite/prepare_protocol.c - type_slots -
Modules/_sqlite/row.c - row_slots -
Modules/_sqlite/statement.c - stmt_slots -
Modules/_sre/sre.c - match_slots -
Modules/_sre/sre.c - pattern_slots -
Modules/_sre/sre.c - scanner_slots -
Modules/_sre.c - match_slots -
Modules/_sre.c - pattern_slots -
Modules/_sre.c - scanner_slots -
Expand All @@ -1200,6 +1238,22 @@ Modules/_ssl.c - sslerror_type_slots -
Modules/_ssl/cert.c - PySSLCertificate_slots -
Modules/_struct.c - PyStructType_slots -
Modules/_struct.c - unpackiter_type_slots -
Modules/_testcapi/heaptype.c - HeapCTypeMetaclassCustomNew_slots -
Modules/_testcapi/heaptype.c - HeapCTypeMetaclass_slots -
Modules/_testcapi/heaptype.c - HeapCTypeSetattr_slots -
Modules/_testcapi/heaptype.c - HeapCTypeSubclassWithFinalizer_slots -
Modules/_testcapi/heaptype.c - HeapCTypeSubclass_slots -
Modules/_testcapi/heaptype.c - HeapCTypeWithBuffer_slots -
Modules/_testcapi/heaptype.c - HeapCTypeWithDict_slots -
Modules/_testcapi/heaptype.c - HeapCTypeWithNegativeDict_slots -
Modules/_testcapi/heaptype.c - HeapCTypeWithWeakref_slots -
Modules/_testcapi/heaptype.c - HeapCType_slots -
Modules/_testcapi/heaptype.c - HeapDocCType_slots -
Modules/_testcapi/heaptype.c - HeapGcCType_slots -
Modules/_testcapi/heaptype.c - NullTpDocType_slots -
Modules/_testcapi/heaptype.c - empty_type_slots -
Modules/_testcapi/heaptype.c - repeated_doc_slots -
Modules/_testcapi/heaptype.c - repeated_members_slots -
Modules/_testcapimodule.c - HeapTypeNameType_slots -
Modules/_testcapimodule.c - NullTpDocType_slots -
Modules/_threadmodule.c - local_dummy_type_slots -
Expand Down Expand Up @@ -1269,6 +1323,8 @@ Modules/_json.c - PyScannerType_spec -
Modules/_lsprof.c - _lsprof_profiler_type_spec -
Modules/_lzmamodule.c - lzma_compressor_type_spec -
Modules/_lzmamodule.c - lzma_decompressor_type_spec -
Modules/_multiprocessing/multiprocessing.h - _PyMp_SemLockType_spec -
Modules/_multiprocessing/semaphore.c - _PyMp_SemLockType_spec -
Modules/_operator.c - attrgetter_type_spec -
Modules/_operator.c - itemgetter_type_spec -
Modules/_operator.c - methodcaller_type_spec -
Expand All @@ -1281,11 +1337,15 @@ Modules/_sha3/sha3module.c - sha3_256_spec -
Modules/_sha3/sha3module.c - sha3_384_spec -
Modules/_sha3/sha3module.c - sha3_512_spec -
Modules/_sha3/sha3module.c - type_spec_obj -
Modules/_sqlite/blob.c - blob_spec -
Modules/_sqlite/connection.c - connection_spec -
Modules/_sqlite/cursor.c - cursor_spec -
Modules/_sqlite/prepare_protocol.c - type_spec -
Modules/_sqlite/row.c - row_spec -
Modules/_sqlite/statement.c - stmt_spec -
Modules/_sre/sre.c - pattern_spec -
Modules/_sre/sre.c - match_spec -
Modules/_sre/sre.c - scanner_spec -
Modules/_sre.c - match_spec -
Modules/_sre.c - pattern_spec -
Modules/_sre.c - scanner_spec -
Expand All @@ -1297,6 +1357,23 @@ Modules/_ssl.c - sslerror_type_spec -
Modules/_ssl/cert.c - PySSLCertificate_spec -
Modules/_struct.c - PyStructType_spec -
Modules/_struct.c - unpackiter_type_spec -
Modules/_testcapi/heaptype.c - MinimalMetaclass_spec -
Modules/_testcapi/heaptype.c - MinimalType_spec -
Modules/_testcapi/heaptype.c - repeated_doc_slots_spec -
Modules/_testcapi/heaptype.c - repeated_members_slots_spec -
Modules/_testcapi/heaptype.c - HeapDocCType_spec -
Modules/_testcapi/heaptype.c - NullTpDocType_spec -
Modules/_testcapi/heaptype.c - HeapGcCType_spec -
Modules/_testcapi/heaptype.c - HeapCType_spec -
Modules/_testcapi/heaptype.c - HeapCTypeSubclass_spec -
Modules/_testcapi/heaptype.c - HeapCTypeWithBuffer_spec -
Modules/_testcapi/heaptype.c - HeapCTypeSubclassWithFinalizer_spec -
Modules/_testcapi/heaptype.c - HeapCTypeMetaclass_spec -
Modules/_testcapi/heaptype.c - HeapCTypeMetaclassCustomNew_spec -
Modules/_testcapi/heaptype.c - HeapCTypeWithDict_spec -
Modules/_testcapi/heaptype.c - HeapCTypeWithNegativeDict_spec -
Modules/_testcapi/heaptype.c - HeapCTypeWithWeakref_spec -
Modules/_testcapi/heaptype.c - HeapCTypeSetattr_spec -
Modules/_testcapimodule.c - HeapTypeNameType_Spec -
Modules/_testcapimodule.c - NullTpDocType_spec -
Modules/_threadmodule.c - local_dummy_type_spec -
Expand Down Expand Up @@ -1423,6 +1500,7 @@ Modules/_ctypes/cfield.c - ffi_type_void -
Modules/_datetimemodule.c - epoch -
Modules/_datetimemodule.c - max_fold_seconds -
Modules/_datetimemodule.c datetime_isoformat specs -
Modules/_datetimemodule.c parse_hh_mm_ss_ff correction -
Modules/_datetimemodule.c time_isoformat specs -
Modules/_decimal/_decimal.c - cond_map -
Modules/_decimal/_decimal.c - dec_signal_string -
Expand All @@ -1437,6 +1515,9 @@ Modules/_io/_iomodule.c - static_types -
Modules/_io/textio.c - encodefuncs -
Modules/_localemodule.c - langinfo_constants -
Modules/_sqlite/module.c - error_codes -
Modules/_sre/sre.c pattern_repr flag_names -
# XXX I'm pretty sure this is actually constant:
Modules/_sre/sre_targets.h - sre_targets -
Modules/_sre.c pattern_repr flag_names -
Modules/_struct.c - bigendian_table -
Modules/_struct.c - lilendian_table -
Expand Down Expand Up @@ -1500,6 +1581,7 @@ Python/ast_opt.c fold_unaryop ops -
Python/codecs.c - Py_hexdigits -
Python/codecs.c - ucnhash_capi -
Python/codecs.c _PyCodecRegistry_Init methods -
Python/compile.c - NO_LOCATION -
Python/dynload_shlib.c - _PyImport_DynLoadFiletab -
Python/dynload_stub.c - _PyImport_DynLoadFiletab -
Python/frozen.c - aliases -
Expand All @@ -1517,4 +1599,5 @@ Python/pylifecycle.c - _TARGET_LOCALES -
Python/specialize.c - adaptive_opcodes -
Python/specialize.c - cache_requirements -
Python/specialize.c - compare_masks -
Python/specialize.c - _PyOpcode_Adaptive -
Python/sysmodule.c - whatstrings -