X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fparser%2FLexer.x;h=cadd56d17d607fc9c242ab52c597dd08dbf34f00;hp=05fe0633d6e16b67d968e2e95effd89bd4e1d76c;hb=fd9f6472d9bb9b521533fdb0cd4a4bf0a742b840;hpb=2d020b840c2515711ee2bd9df285dd977fdac644 diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 05fe063..cadd56d 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -1349,11 +1349,13 @@ readNum2 is_digit base conv i = do where read i input = do case alexGetChar' input of Just (c,input') | is_digit c -> do - read (i*base + conv c) input' + let i' = i*base + conv c + if i' > 0x10ffff + then setInput input >> lexError "numeric escape sequence out of range" + else read i' input' _other -> do - if i >= 0 && i <= 0x10FFFF - then do setInput input; return (chr i) - else lit_error input + setInput input; return (chr i) + silly_escape_chars :: [(String, Char)] silly_escape_chars = [