mirror of
https://github.com/cc65/cc65.git
synced 2025-01-11 11:30:13 +00:00
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:
parent
3fb0c660dc
commit
ce931b85be
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user