From b682648b27bd7fa8500d9110cbf91a65d68d71a4 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Wed, 29 Jan 2014 22:06:30 -0800 Subject: [PATCH] Fix infinite loop in identifier lexing --- stdx/d/lexer.d | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stdx/d/lexer.d b/stdx/d/lexer.d index ca05a92..670afcb 100644 --- a/stdx/d/lexer.d +++ b/stdx/d/lexer.d @@ -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);