Fixed an internal compiler error when the first token of a source file
caused an error message. In this case, the line info was not available leading to a PRECONDITION VIOLATED. git-svn-id: svn://svn.cc65.org/cc65/trunk@2370 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -396,6 +396,14 @@ void NextToken (void)
|
|||||||
}
|
}
|
||||||
CurTok = NextTok;
|
CurTok = NextTok;
|
||||||
|
|
||||||
|
/* When reading the first time from the file, the line info in NextTok,
|
||||||
|
* which was copied to CurTok is invalid. Since the information from
|
||||||
|
* the token is used for error messages, we must make it valid.
|
||||||
|
*/
|
||||||
|
if (CurTok.LI == 0) {
|
||||||
|
CurTok.LI = UseLineInfo (GetCurLineInfo ());
|
||||||
|
}
|
||||||
|
|
||||||
/* Remember the starting position of the next token */
|
/* Remember the starting position of the next token */
|
||||||
NextTok.LI = UseLineInfo (GetCurLineInfo ());
|
NextTok.LI = UseLineInfo (GetCurLineInfo ());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user