diff options
author | yui-knk <spiketeika@gmail.com> | 2023-10-14 10:57:47 +0900 |
---|---|---|
committer | Yuichiro Kaneko <spiketeika@gmail.com> | 2023-10-15 16:16:06 +0900 |
commit | 5342dbf00bd87099a15e90d5375d44dff81493ac (patch) | |
tree | 58ea8000fa09521534c2f9a1f197694b5bd7d207 /parse.y | |
parent | e7e31d77848797703de60ea4aa095a3ec9e6c762 (diff) |
Check node type before accessing nd_next
This is also a preparation for removing not_used members from
STR NODE. Current codes work without node type check because NODE_STR
has not_used2 member corresponding to nd_next of NODE_LIST and
NODE_DSTR. However it causes problme once not_used members are
removed from NODE_STR.
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -8830,7 +8830,7 @@ heredoc_dedent(struct parser_params *p, NODE *root) } str_node = 0; - while ((node = RNODE_LIST(prev_node = node)->nd_next) != 0) { + while ((nd_type_p(node, NODE_LIST) || nd_type_p(node, NODE_DSTR)) && (node = RNODE_LIST(prev_node = node)->nd_next) != 0) { next_str: if (!nd_type_p(node, NODE_LIST)) break; if ((str_node = RNODE_LIST(node)->nd_head) != 0) { |