fix heredoc crash
we emitted an error on heredoc tags, but we continued on, and added a heredoc entry to the list, with a tag that we couldn't handle. when processing this heredoc, rc would segfault. fix: don't add a heredoc to the list on error.
This commit is contained in:
parent
698837e715
commit
fc90f7a666
1 changed files with 6 additions and 2 deletions
|
@ -22,9 +22,13 @@ hexnum(char *p, int n)
|
||||||
tree*
|
tree*
|
||||||
heredoc(tree *tag)
|
heredoc(tree *tag)
|
||||||
{
|
{
|
||||||
struct here *h = new(struct here);
|
struct here *h;
|
||||||
if(tag->type!=WORD)
|
|
||||||
|
if(tag->type!=WORD){
|
||||||
yyerror("Bad here tag");
|
yyerror("Bad here tag");
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
h = new(struct here);
|
||||||
h->next = 0;
|
h->next = 0;
|
||||||
if(here)
|
if(here)
|
||||||
*ehere = h;
|
*ehere = h;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue