Skip to content

Commit 6c61feb

Browse files
committed
Extend whitelist of non-escaping API functions.
1 parent 9cda14b commit 6c61feb

File tree

2 files changed

+53
-43
lines changed

2 files changed

+53
-43
lines changed

Include/internal/pycore_opcode_metadata.h

Lines changed: 43 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tools/cases_generator/flags.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@
3131
"_PyLong_IsNonNegativeCompact",
3232
"_PyLong_CompactValue",
3333
"_Py_NewRef",
34+
"_Py_IsImmortal",
35+
"_Py_STR",
36+
"_PyLong_Add",
37+
"_PyLong_Multiply",
38+
"_PyLong_Subtract",
39+
"Py_NewRef",
40+
"_PyList_ITEMS",
41+
"_PyTuple_ITEMS",
3442
)
3543

3644
def makes_escaping_api_call(instr: parsing.Node) -> bool:
@@ -48,6 +56,8 @@ def makes_escaping_api_call(instr: parsing.Node) -> bool:
4856
continue
4957
if tkn.text.endswith("Check"):
5058
continue
59+
if tkn.text.startswith("Py_Is"):
60+
continue
5161
if tkn.text.endswith("CheckExact"):
5262
continue
5363
if tkn.text in WHITELIST:

0 commit comments

Comments
 (0)