summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2020-06-08 00:47:37 (GMT)
committerGitHub <noreply@github.com>2020-06-08 00:47:37 (GMT)
commit972ab0327675e695373fc6272d5ac24e187579ad (patch)
treeb5056a67e0f85f85d23ecf2bb08437efd1d41e69 /Parser
parentbcb198385dee469d630a184182df9dc1463e2c47 (diff)
downloadcpython-972ab0327675e695373fc6272d5ac24e187579ad.zip
cpython-972ab0327675e695373fc6272d5ac24e187579ad.tar.gz
cpython-972ab0327675e695373fc6272d5ac24e187579ad.tar.bz2
bpo-40904: Fix segfault in the new parser with f-string containing yield statements with no value (GH-20701)
Diffstat (limited to 'Parser')
-rw-r--r--Parser/pegen/parse_string.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Parser/pegen/parse_string.c b/Parser/pegen/parse_string.c
index efe82df..94241e1 100644
--- a/Parser/pegen/parse_string.c
+++ b/Parser/pegen/parse_string.c
@@ -278,6 +278,9 @@ static void fstring_shift_argument(expr_ty parent, arg_ty args, int lineno, int
static inline void shift_expr(expr_ty parent, expr_ty n, int line, int col) {
+ if (n == NULL) {
+ return;
+ }
if (parent->lineno < n->lineno) {
col = 0;
}