Skip to content

Commit 80cbec8

Browse files
committed
gh-159672: Declare keyword aliases as immutable data
Use a named alias type with constant pointer fields so the alias table is explicitly immutable.
1 parent 3343af0 commit 80cbec8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎Parser/pegen.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1307,7 +1307,10 @@ collect_keyword_typos(Parser *p, PySyntaxErrorObject *error, KeywordTypo *candid
13071307
start = i + 1;
13081308
}
13091309
}
1310-
static const struct { const char *name, *keyword; } aliases[] = {
1310+
static const struct {
1311+
const char *name;
1312+
const char *keyword;
1313+
} aliases[] = {
13111314
{"switch", "match"},
13121315
{"delete", "del"},
13131316
{"function", "def"},

0 commit comments

Comments
 (0)