Skip to content

gh-100747: some compiler macros use c instead of C to access the compiler #100748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@
(opcode) == STORE_FAST__LOAD_FAST || \
(opcode) == STORE_FAST__STORE_FAST)

#define IS_TOP_LEVEL_AWAIT(c) ( \
(c->c_flags.cf_flags & PyCF_ALLOW_TOP_LEVEL_AWAIT) \
&& (c->u->u_ste->ste_type == ModuleBlock))
#define IS_TOP_LEVEL_AWAIT(C) ( \
((C)->c_flags.cf_flags & PyCF_ALLOW_TOP_LEVEL_AWAIT) \
&& ((C)->u->u_ste->ste_type == ModuleBlock))

typedef _PyCompilerSrcLocation location;

Expand Down Expand Up @@ -479,7 +479,7 @@ struct compiler {
PyArena *c_arena; /* pointer to memory allocation arena */
};

#define CFG_BUILDER(c) (&((c)->u->u_cfg_builder))
#define CFG_BUILDER(C) (&((C)->u->u_cfg_builder))


typedef struct {
Expand Down Expand Up @@ -1626,7 +1626,7 @@ cfg_builder_addop_j(cfg_builder *g, location loc,

#define ADDOP_IN_SCOPE(C, LOC, OP) { \
if (cfg_builder_addop_noarg(CFG_BUILDER(C), (OP), (LOC)) < 0) { \
compiler_exit_scope(c); \
compiler_exit_scope(C); \
return -1; \
} \
}
Expand Down Expand Up @@ -1692,7 +1692,7 @@ cfg_builder_addop_j(cfg_builder *g, location loc,

#define VISIT_IN_SCOPE(C, TYPE, V) {\
if (compiler_visit_ ## TYPE((C), (V)) < 0) { \
compiler_exit_scope(c); \
compiler_exit_scope(C); \
return ERROR; \
} \
}
Expand All @@ -1713,7 +1713,7 @@ cfg_builder_addop_j(cfg_builder *g, location loc,
for (_i = 0; _i < asdl_seq_LEN(seq); _i++) { \
TYPE ## _ty elt = (TYPE ## _ty)asdl_seq_GET(seq, _i); \
if (compiler_visit_ ## TYPE((C), elt) < 0) { \
compiler_exit_scope(c); \
compiler_exit_scope(C); \
return ERROR; \
} \
} \
Expand Down