123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197(****************************************************************************)(* *)(* This file is part of MOPSA, a Modular Open Platform for Static Analysis. *)(* *)(* Copyright (C) 2017-2022 The MOPSA Project. *)(* *)(* This program is free software: you can redistribute it and/or modify *)(* it under the terms of the GNU Lesser General Public License as published *)(* by the Free Software Foundation, either version 3 of the License, or *)(* (at your option) any later version. *)(* *)(* This program is distributed in the hope that it will be useful, *)(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)(* GNU Lesser General Public License for more details. *)(* *)(* You should have received a copy of the GNU Lesser General Public License *)(* along with this program. If not, see <http://www.gnu.org/licenses/>. *)(* *)(****************************************************************************)openMopsaopenPython.Addrletbuiltin_exceptions=["PyExc_BaseException";"PyExc_Exception";"PyExc_StopAsyncIteration";"PyExc_StopIteration";"PyExc_GeneratorExit";"PyExc_ArithmeticError";"PyExc_LookupError";"PyExc_AssertionError";"PyExc_AttributeError";"PyExc_BufferError";"PyExc_EOFError";"PyExc_FloatingPointError";"PyExc_OSError";"PyExc_ImportError";"PyExc_ModuleNotFoundError";"PyExc_IndexError";"PyExc_KeyError";"PyExc_KeyboardInterrupt";"PyExc_MemoryError";"PyExc_NameError";"PyExc_OverflowError";"PyExc_RuntimeError";"PyExc_RecursionError";"PyExc_NotImplementedError";"PyExc_SyntaxError";"PyExc_IndentationError";"PyExc_TabError";"PyExc_ReferenceError";"PyExc_SystemError";"PyExc_SystemExit";"PyExc_TypeError";"PyExc_UnboundLocalError";"PyExc_ValueError";"PyExc_UnicodeError";"PyExc_UnicodeEncodeError";"PyExc_UnicodeDecodeError";"PyExc_UnicodeTranslateError";"PyExc_ZeroDivisionError";"PyExc_BlockingIOError";"PyExc_ConnectionError";"PyExc_BrokenPipeError";"PyExc_ChildProcessError";"PyExc_ConnectionAbortedError";"PyExc_ConnectionRefusedError";"PyExc_ConnectionResetError";"PyExc_FileExistsError";"PyExc_FileNotFoundError";"PyExc_InterruptedError";"PyExc_IsADirectoryError";"PyExc_NotADirectoryError";"PyExc_PermissionError";"PyExc_ProcessLookupError";"PyExc_TimeoutError";"PyExc_EnvironmentError";"PyExc_IOError";"PyExc_Warning";"PyExc_UserWarning";"PyExc_DeprecationWarning";"PyExc_PendingDeprecationWarning";"PyExc_SyntaxWarning";"PyExc_RuntimeWarning";"PyExc_FutureWarning";"PyExc_ImportWarning";"PyExc_UnicodeWarning";"PyExc_BytesWarning";"PyExc_ResourceWarning";]let()=C.Cstubs.Resources.register_is_resource_addr_chain(funnextak->matchakwith(* FIXME: other container addresses *)|Python.Objects.Py_list.A_py_list|Python.Objects.Py_list.A_py_iterator_|Python.Objects.Py_set.A_py_set|Python.Objects.Tuple.A_py_tuple_|Python.Objects.Dict.A_py_dict|A_py_instance_|A_py_class_|A_py_c_class_|A_py_c_function_|A_py_c_module_|A_py_function_|A_py_method_|A_py_module_->true|_->nextak)let()=C.Common.Base.register_addr_opaque(funnext->function|Python.Objects.Py_list.A_py_list|Python.Objects.Py_list.A_py_iterator_|Python.Objects.Py_set.A_py_set|Python.Objects.Tuple.A_py_tuple_|Python.Objects.Dict.A_py_dict|A_py_instance{addr_kind=A_py_class(C_builtin_,_)}->OpaqueFrom8|ak->nextak)letbuiltin_functions=["PyModule_Create2";"PyModule_AddObject";"PyType_FromSpec";"PyType_Ready";"PyType_GenericAlloc_Helper";"PyType_IsSubtype";"PyArg_ParseTuple";"PyArg_ParseTupleAndKeywords";"PyArg_UnpackTuple";"Py_BuildValue";"PyNumber_Add";"PyObject_CallFunction";"PyObject_CallObject";"PyObject_CallMethod";"PyObject_GetAttrString";"PyObject_GetItem";"PyObject_GetIter";"PyObject_RichCompare";"PyObject_RichCompareBool";"PyObject_Size";"PyObject_Repr";"PyObject_Length";"PyObject_IsTrue";"PyIter_Next";"PySequence_GetSlice";"PyLong_FromLong";"PyLong_FromUnsignedLong";"PyLong_FromSsize_t";"PyLong_AsLong";"PyLong_AsSsize_t";"PyFloat_FromDouble";"PyFloat_AsDouble";"PyBytes_FromStringAndSize";"PyBytes_Size";"PyBytes_AsString";"PyUnicode_GetItem";"PyUnicode_Concat";"PyUnicode_GetLength";"PyUnicode_InternFromString";"PyUnicode_FromString";"PyUnicode_FromKindAndData";"PyUnicode_FromWideChar";"PyUnicode_AsEncodedString";"PyUnicode_AsUnicode";"PyUnicode_AsUTF8AndSize";"PyTuple_New";"PyTuple_SetItem";"PyTuple_Size";"PyTuple_GetItem";"PyTuple_GetSlice";"PyList_New";"PyList_Size";"PyList_GetItem";"PyList_SetItem";"PyList_Append";"PyDict_Size";"PyDict_Next";"PyDict_New";"PyDict_GetItem";"PyDict_SetItem";"PySlice_New";"PySet_New";"PySet_Size";"PySet_Add";"PySet_Clear";"PyWeakref_NewRef";"PyWeakref_GetObject";"PyErr_NewException";]