mirror of
https://github.com/cc65/cc65.git
synced 2025-01-12 02:30:44 +00:00
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:
parent
5890278a69
commit
7596da75f0
@ -396,6 +396,14 @@ void NextToken (void)
|
||||
}
|
||||
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 */
|
||||
NextTok.LI = UseLineInfo (GetCurLineInfo ());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user