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