[flang-commits] [flang] fa6c3df - [flang] Don't use \uXXXX encodings unless \-escapes are enabled (#78326)

via flang-commits flang-commits at lists.llvm.org
Thu Jan 18 11:05:08 PST 2024


Author: Peter Klausler
Date: 2024-01-18T11:05:04-08:00
New Revision: fa6c3df6add2559ee6f31762e7667cedc6e31a0b

URL: https://github.com/llvm/llvm-project/commit/fa6c3df6add2559ee6f31762e7667cedc6e31a0b
DIFF: https://github.com/llvm/llvm-project/commit/fa6c3df6add2559ee6f31762e7667cedc6e31a0b.diff

LOG: [flang] Don't use \uXXXX encodings unless \-escapes are enabled (#78326)

Don't put \uXXXX escapes into the cooked character stream while
prescanning; it should always be UTF-8.

Added: 
    

Modified: 
    flang/include/flang/Parser/characters.h

Removed: 
    


################################################################################
diff  --git a/flang/include/flang/Parser/characters.h b/flang/include/flang/Parser/characters.h
index dae0d3e2a0cfff..df188d674b9eeb 100644
--- a/flang/include/flang/Parser/characters.h
+++ b/flang/include/flang/Parser/characters.h
@@ -237,7 +237,7 @@ void EmitQuotedChar(char32_t ch, const NORMAL &emit, const INSERTED &insert,
   }};
   if (ch <= 0x7f) {
     emitOneByte(ch);
-  } else if (useHexadecimalEscapeSequences) {
+  } else if (backslashEscapes && useHexadecimalEscapeSequences) {
     insert('\\');
     insert('u');
     if (ch > 0xffff) {


        


More information about the flang-commits mailing list