summaryrefslogtreecommitdiffstats
path: root/Tools/cases_generator
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-04-19 08:25:07 (GMT)
committerGitHub <noreply@github.com>2024-04-19 08:25:07 (GMT)
commitd3bd6b5f3f48731715e21fe132b8e65a4e5f6ce8 (patch)
treebdf065fa2eb1e8a8795ee9650ff0d633c6c802e9 /Tools/cases_generator
parentfefd5d97111364afa027ae580c3244f427dda59d (diff)
downloadcpython-d3bd6b5f3f48731715e21fe132b8e65a4e5f6ce8.zip
cpython-d3bd6b5f3f48731715e21fe132b8e65a4e5f6ce8.tar.gz
cpython-d3bd6b5f3f48731715e21fe132b8e65a4e5f6ce8.tar.bz2
GH-115419: Improve list of escaping functions (GH-118054)
Diffstat (limited to 'Tools/cases_generator')
-rw-r--r--Tools/cases_generator/analyzer.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Tools/cases_generator/analyzer.py b/Tools/cases_generator/analyzer.py
index e38ab3c..d17b2b9 100644
--- a/Tools/cases_generator/analyzer.py
+++ b/Tools/cases_generator/analyzer.py
@@ -358,6 +358,7 @@ NON_ESCAPING_FUNCTIONS = (
"_PyObject_InlineValues",
"_PyDictValues_AddToInsertionOrder",
"Py_DECREF",
+ "Py_XDECREF",
"_Py_DECREF_SPECIALIZED",
"DECREF_INPUTS_AND_REUSE_FLOAT",
"PyUnicode_Append",
@@ -365,6 +366,7 @@ NON_ESCAPING_FUNCTIONS = (
"Py_SIZE",
"Py_TYPE",
"PyList_GET_ITEM",
+ "PyList_SET_ITEM",
"PyTuple_GET_ITEM",
"PyList_GET_SIZE",
"PyTuple_GET_SIZE",
@@ -400,8 +402,14 @@ NON_ESCAPING_FUNCTIONS = (
"PySlice_New",
"_Py_LeaveRecursiveCallPy",
"CALL_STAT_INC",
+ "STAT_INC",
"maybe_lltrace_resume_frame",
"_PyUnicode_JoinArray",
+ "_PyEval_FrameClearAndPop",
+ "_PyFrame_StackPush",
+ "PyCell_New",
+ "PyFloat_AS_DOUBLE",
+ "_PyFrame_PushUnchecked",
)
ESCAPING_FUNCTIONS = (
@@ -427,6 +435,8 @@ def makes_escaping_api_call(instr: parser.InstDef) -> bool:
continue
if tkn.text in ESCAPING_FUNCTIONS:
return True
+ if tkn.text == "tp_vectorcall":
+ return True
if not tkn.text.startswith("Py") and not tkn.text.startswith("_Py"):
continue
if tkn.text.endswith("Check"):