From 6516fda5b3a623bf6fd54ef36f99a336fc7f268d Mon Sep 17 00:00:00 2001 From: John Hodge Date: Fri, 19 Aug 2016 11:23:12 +0800 Subject: Fix little bugs in recent spate of fixes --- src/parse/lex.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/parse') diff --git a/src/parse/lex.cpp b/src/parse/lex.cpp index 42e36574..6e274adc 100644 --- a/src/parse/lex.cpp +++ b/src/parse/lex.cpp @@ -1202,14 +1202,14 @@ bool Codepoint::isxdigit() const { s += (char)(0x80 | ((cp.v >> 6) & 0x3F)); s += (char)(0x80 | ((cp.v >> 0) & 0x3F)); } - else if( cp.v <= (0x07+1)<<(2*6) ) { + else if( cp.v <= (0x07+1)<<(3*6) ) { s += (char)(0xF0 | ((cp.v >> 18) & 0x07)); s += (char)(0x80 | ((cp.v >> 12) & 0x3F)); s += (char)(0x80 | ((cp.v >> 6) & 0x3F)); s += (char)(0x80 | ((cp.v >> 0) & 0x3F)); } else { - throw ::std::runtime_error("BUGCHECK: Bad unicode codepoint encountered"); + throw ::std::runtime_error( FMT("BUGCHECK: Bad unicode codepoint encountered - " << ::std::hex << cp.v) ); } return s; } -- cgit v1.2.3