Fix infinite loop in identifier lexing

This commit is contained in:
Hackerpilot 2014-01-29 22:06:30 -08:00
parent bf7f098799
commit b682648b27
1 changed files with 5 additions and 0 deletions

View File

@ -1363,6 +1363,11 @@ public struct DLexer
import std.stdio;
mixin (tokenStart);
uint hash = 0;
if (isSeparating(0) || range.empty)
{
error("Invalid identifier");
range.popFront();
}
while (!range.empty && !isSeparating(0))
{
hash = StringCache.hashStep(range.front, hash);