Matthew Pickering pushed to branch wip/romes/ast-ohne-faststring at Glasgow Haskell Compiler / GHC Commits: df7aca9b by Matthew Pickering at 2026-02-13T12:09:04+00:00 Correctness fix for mkFastStringText - - - - - 4 changed files: - compiler/GHC/Data/FastString.hs - + testsuite/tests/parser/should_run/StringStartsWithNull.hs - + testsuite/tests/parser/should_run/StringStartsWithNull.stdout - testsuite/tests/parser/should_run/all.T Changes: ===================================== compiler/GHC/Data/FastString.hs ===================================== @@ -558,7 +558,7 @@ mkFastStringShortByteString sbs = -- | Create a UTF-8 encoded 'FastString' from a 'Text' mkFastStringText :: T.Text -> FastString -mkFastStringText = mkFastStringByteString . T.encodeUtf8 +mkFastStringText = mkFastString . T.unpack -- | Creates a UTF-8 encoded 'FastString' from a 'String' mkFastString :: String -> FastString ===================================== testsuite/tests/parser/should_run/StringStartsWithNull.hs ===================================== @@ -0,0 +1,4 @@ +module Main where + +main :: IO () +main = print "\0a" ===================================== testsuite/tests/parser/should_run/StringStartsWithNull.stdout ===================================== @@ -0,0 +1 @@ +"\NULa" ===================================== testsuite/tests/parser/should_run/all.T ===================================== @@ -20,6 +20,7 @@ test('HexFloatLiterals', normal, compile_and_run, ['']) test('NumericUnderscores0', normal, compile_and_run, ['']) test('NumericUnderscores1', normal, compile_and_run, ['']) test('LexNegLit', normal, compile_and_run, ['']) +test('StringStartsWithNull', normal, compile_and_run, ['']) test('RecordDotSyntax1', normal, compile_and_run, ['']) test('RecordDotSyntax2', normal, compile_and_run, ['']) test('RecordDotSyntax3', [extra_files(['RecordDotSyntaxA.hs'])], multimod_compile_and_run, ['RecordDotSyntax3', '']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/df7aca9b1bad62358b40e8a7d05b2c22... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/df7aca9b1bad62358b40e8a7d05b2c22... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Matthew Pickering (@mpickering)