[PATCH] D103426: Clang: Extend format string checking to wprintf/wscanf
    Corentin Jabot via Phabricator via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Mon Jun 21 12:11:11 PDT 2021
    
    
  
cor3ntin added inline comments.
================
Comment at: clang/lib/AST/OSLog.cpp:214
+    std::u16string U16 = Lit->getStringAsChar16();
+    String = Convert.to_bytes(U16); // u"char16_t String"
+  } else if (Lit->isUTF32()) {
----------------
If `getStringAsChar16` contains the string after `\x` escape replacement, it might contain invalid code units or lone surrogate, in which case `to_bytes` might throw if `Convert` is not initialized with an error string
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103426/new/
https://reviews.llvm.org/D103426
    
    
More information about the cfe-commits
mailing list