diff options
author | Daniel Jasper <djasper@google.com> | 2015-07-20 23:28:07 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-07-20 23:28:07 +0000 |
commit | 8c6f4375dc7607ec15e8b961d009729dbd27c91c (patch) | |
tree | 3e6314924297293089f8726e20f7c4f5602cf53a /lib/Format/Encoding.h | |
parent | dfc90655662a0704da39a0a8cb0f341155378e2c (diff) |
clang-format: Fix crasher when a UTF8 character is found in an escape
sequence. Discovered by the fuzzer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@242738 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/Encoding.h')
-rw-r--r-- | lib/Format/Encoding.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Format/Encoding.h b/lib/Format/Encoding.h index 766d29274c..592d7201a8 100644 --- a/lib/Format/Encoding.h +++ b/lib/Format/Encoding.h @@ -135,7 +135,7 @@ inline unsigned getEscapeSequenceLength(StringRef Text) { ++I; return I; } - return 2; + return 1 + getNumBytesForUTF8(Text[1]); } } |