In case of parse errors for structs, don't just set the type of the result to

"int", return a valid lvalue instead.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4483 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2009-11-24 23:02:58 +00:00
parent 3fb0c660dc
commit ce931b85be

View File

@ -1097,7 +1097,8 @@ static void StructRef (ExprDesc* Expr)
NextToken ();
if (CurTok.Tok != TOK_IDENT) {
Error ("Identifier expected");
Expr->Type = type_int;
/* Make the expression an integer at address zero */
ED_MakeConstAbs (Expr, 0, type_int);
return;
}
@ -1107,7 +1108,8 @@ static void StructRef (ExprDesc* Expr)
Field = FindStructField (Expr->Type, Ident);
if (Field == 0) {
Error ("Struct/union has no field named `%s'", Ident);
Expr->Type = type_int;
/* Make the expression an integer at address zero */
ED_MakeConstAbs (Expr, 0, type_int);
return;
}