summaryrefslogtreecommitdiffstats
path: root/Python/optimizer_analysis.c
diff options
context:
space:
mode:
authorKen Jin <kenjin@python.org>2024-02-16 14:59:43 (GMT)
committerGitHub <noreply@github.com>2024-02-16 14:59:43 (GMT)
commitf92857a93016aa26ba93959d2bdb690ef52e7f07 (patch)
tree1ff8a1c20e2cc7d8f3cb2a3e79c41a1506723a42 /Python/optimizer_analysis.c
parent144eb5605b445d22729db6c416d03cc24947ba56 (diff)
downloadcpython-f92857a93016aa26ba93959d2bdb690ef52e7f07.zip
cpython-f92857a93016aa26ba93959d2bdb690ef52e7f07.tar.gz
cpython-f92857a93016aa26ba93959d2bdb690ef52e7f07.tar.bz2
gh-115480: Minor fixups in int constant propagation (GH-115507)
Diffstat (limited to 'Python/optimizer_analysis.c')
-rw-r--r--Python/optimizer_analysis.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/Python/optimizer_analysis.c b/Python/optimizer_analysis.c
index d73bc31..b104d2f 100644
--- a/Python/optimizer_analysis.c
+++ b/Python/optimizer_analysis.c
@@ -588,16 +588,17 @@ remove_globals(_PyInterpreterFrame *frame, _PyUOpInstruction *buffer,
INST->oparg = ARG; \
INST->operand = OPERAND;
+#define OUT_OF_SPACE_IF_NULL(EXPR) \
+ do { \
+ if ((EXPR) == NULL) { \
+ goto out_of_space; \
+ } \
+ } while (0);
+
#define _LOAD_ATTR_NOT_NULL \
do { \
- attr = sym_new_known_notnull(ctx); \
- if (attr == NULL) { \
- goto error; \
- } \
- null = sym_new_null(ctx); \
- if (null == NULL) { \
- goto error; \
- } \
+ OUT_OF_SPACE_IF_NULL(attr = sym_new_known_notnull(ctx)); \
+ OUT_OF_SPACE_IF_NULL(null = sym_new_null(ctx)); \
} while (0);