summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorBénédikt Tran <10796600+picnixz@users.noreply.github.com>2024-11-07 23:03:11 (GMT)
committerGitHub <noreply@github.com>2024-11-07 23:03:11 (GMT)
commitc222441fa7f89d448e476c252ba09be588568392 (patch)
treefbcf1152928a1547678abdb8678b1665bdad2099 /Python/compile.c
parentbbe9b21d06c192a616bc1720ec8f7d4ccc16cab8 (diff)
downloadcpython-c222441fa7f89d448e476c252ba09be588568392.zip
cpython-c222441fa7f89d448e476c252ba09be588568392.tar.gz
cpython-c222441fa7f89d448e476c252ba09be588568392.tar.bz2
gh-120017: use 'do-while(0)' in some `{codegen,compile}.c` multi-line macros (#120018)
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Python/compile.c b/Python/compile.c
index ecca9b0..cbfba7f 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -31,9 +31,11 @@
#define ERROR -1
#define RETURN_IF_ERROR(X) \
- if ((X) == -1) { \
- return ERROR; \
- }
+ do { \
+ if ((X) == -1) { \
+ return ERROR; \
+ } \
+ } while (0)
typedef _Py_SourceLocation location;
typedef _PyJumpTargetLabel jump_target_label;