bug fix, avoid segfault when parsing an unknown function in parse-bison.y
This commit is contained in:
parent
b7df40c2b6
commit
74f7a4f908
|
|
@ -1,3 +1,10 @@
|
|||
2010-08-07 Robert Larice
|
||||
* src/frontend/parse-bison.c ,
|
||||
* src/frontend/parse-bison.h ,
|
||||
* src/frontend/parse-bison.y :
|
||||
bug fix,
|
||||
avoid segfault, caused when parsing an unknown function in parse-bison.y
|
||||
|
||||
2010-08-07 Dietmar Warning
|
||||
spicelib/devices/*/b4soimask.c, csw*.c, mos6load.c, soi3load.c, swnoise.c:
|
||||
fix some wrong 'double' to 'int' assignments
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ typedef union YYSTYPE
|
|||
const char *str;
|
||||
struct pnode *pnode;
|
||||
}
|
||||
/* Line 193 of yacc.c. */
|
||||
/* Line 187 of yacc.c. */
|
||||
#line 166 "parse-bison.c"
|
||||
YYSTYPE;
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
|
|
@ -1579,7 +1579,7 @@ yyreduce:
|
|||
|
||||
case 19:
|
||||
#line 142 "parse-bison.y"
|
||||
{ (yyval.pnode) = mkfnode((yyvsp[(1) - (4)].str), (yyvsp[(3) - (4)].pnode)); ;}
|
||||
{ (yyval.pnode) = mkfnode((yyvsp[(1) - (4)].str), (yyvsp[(3) - (4)].pnode)); if(!(yyval.pnode)) YYABORT; ;}
|
||||
break;
|
||||
|
||||
case 20:
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ typedef union YYSTYPE
|
|||
const char *str;
|
||||
struct pnode *pnode;
|
||||
}
|
||||
/* Line 1529 of yacc.c. */
|
||||
/* Line 1489 of yacc.c. */
|
||||
#line 75 "parse-bison.h"
|
||||
YYSTYPE;
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ exp:
|
|||
| '-' exp %prec NEG { $$ = mkunode(UMINUS, $2); }
|
||||
| '~' exp { $$ = mkunode(NOT, $2); }
|
||||
|
||||
| TOK_STR '(' exp ')' { $$ = mkfnode($1, $3); }
|
||||
| TOK_STR '(' exp ')' { $$ = mkfnode($1, $3); if(!$$) YYABORT; }
|
||||
|
||||
| exp '=' exp { $$ = mkbnode(EQ, $1, $3); }
|
||||
| exp TOK_NE exp { $$ = mkbnode(NE, $1, $3); }
|
||||
|
|
|
|||
Loading…
Reference in New Issue