[PATCH] D41290: [YAML] Add support for non-printable characters

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 19 03:54:25 PST 2017


thegameg marked an inline comment as done.
thegameg added inline comments.


================
Comment at: llvm/trunk/include/llvm/Support/YAMLTraits.h:552-555
+      // C1 control block (0x80 - 0x9F) is excluded from the allowed character
+      // range.
+      if (C >= 0x80 && C <= 0x9F)
+        return QuotingType::Double;
----------------
MatzeB wrote:
> This part is sketchy. As we are most probably dealing with UTF-8 without having fully parsed code point here. (Not that the code/comments give any indication that we indeed have UTF-8). While for ASCII (= top bit is clear) UTF-8 and ASCII are the same, for other characters (top bit set) it is not.
> 
> I think the best/easiest thing to do here is to always trigger double quoting on `(C & 0x80) != 0`
Ah, I quickly skipped that part...

Should be fixed in [[ https://reviews.llvm.org/rL321068 | r321068 ]].


Repository:
  rL LLVM

https://reviews.llvm.org/D41290





More information about the llvm-commits mailing list