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.
This commit is contained in:
parent
e7e31d7784
commit
5342dbf00b
2
parse.y
2
parse.y
@ -8830,7 +8830,7 @@ heredoc_dedent(struct parser_params *p, NODE *root)
|
|||||||
}
|
}
|
||||||
|
|
||||||
str_node = 0;
|
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:
|
next_str:
|
||||||
if (!nd_type_p(node, NODE_LIST)) break;
|
if (!nd_type_p(node, NODE_LIST)) break;
|
||||||
if ((str_node = RNODE_LIST(node)->nd_head) != 0) {
|
if ((str_node = RNODE_LIST(node)->nd_head) != 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user