From 6dbf49fdb4a50e006b52fef202f1ec65b8d0e333 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Mon, 13 Sep 2021 12:20:11 +0900 Subject: parse.y: `cons_free` unused node (empty string node). --- mrbgems/mruby-compiler/core/parse.y | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mrbgems/mruby-compiler/core/parse.y') diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y index d71e90176..637b04749 100644 --- a/mrbgems/mruby-compiler/core/parse.y +++ b/mrbgems/mruby-compiler/core/parse.y @@ -3326,6 +3326,9 @@ string_fragment : tCHAR if (intn($3->cdr->cdr) > 0) { n = push(n, $3); } + else { + cons_free($3); + } $$ = new_dstr(p, n); } ; @@ -3372,6 +3375,9 @@ xstring : tXSTRING_BEG tXSTRING if (intn($3->cdr->cdr) > 0) { n = push(n, $3); } + else { + cons_free($3); + } $$ = new_dxstr(p, n); } ; @@ -3439,6 +3445,9 @@ words : tWORDS_BEG tSTRING if (intn($3->cdr->cdr) > 0) { n = push(n, $3); } + else { + cons_free($3); + } $$ = new_words(p, n); } ; @@ -3456,6 +3465,9 @@ symbol : basic_symbol if (intn($4->cdr->cdr) > 0) { n = push(n, $4); } + else { + cons_free($4); + } $$ = new_dsym(p, new_dstr(p, n)); } ; -- cgit v1.2.3