[PATCH] D46274: [Support] Harden JSON against invalid UTF-8.

Sam McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 30 10:26:59 PDT 2018


sammccall created this revision.
sammccall added a reviewer: benhamilton.
Herald added a subscriber: llvm-commits.

Parsing invalid UTF-8 input is now a parse error.
Creating JSON values from invalid UTF-8 now triggers an assertion, and
(in no-assert builds) substitutes the unicode replacement character.
Strings retrieved from json::Value are always valid UTF-8.


Repository:
  rL LLVM

https://reviews.llvm.org/D46274

Files:
  include/llvm/Support/JSON.h
  lib/Support/JSON.cpp
  unittests/Support/JSONTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46274.144585.patch
Type: text/x-patch
Size: 10079 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180430/9149598e/attachment-0001.bin>


More information about the llvm-commits mailing list