Set the token type after an invalid character error.

Otherwise, it still has the previous token's type. This can cause it
to get stuck in a loop in some places in the compiler.

Fix #428.
This commit is contained in:
Bob Nystrom
2017-03-23 21:19:20 -07:00
parent 02bcefcbe4
commit 44a95e65c6
2 changed files with 21 additions and 5 deletions

6
test/regression/428.wren Normal file
View File

@ -0,0 +1,6 @@
// This was crashing the compiler with an out of bounds memory access.
// expect error line 6
// expect error line 7
Fiber.new {
isDone ["", àààààààààààààààààààààààààààààààààààààààààààààààààà