hanchenye-llvm-project/clang/test/Lexer
Volodymyr Sapsai 579f0b307c [Lex] Fix handling numerical literals ending with ' and signed exponent.
For input `0'e+1` lexer tokenized as numeric constant only `0'e`. Later
NumericLiteralParser skipped 0 and ' as digits and parsed `e+1` as valid
exponent going past the end of the token. Because it didn't mark numeric
literal as having an error, it continued parsing and tried to expandUCNs
with StringRef of length -2.

The fix is not to parse exponent when we reached the end of token.

Discovered by OSS-Fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4588

rdar://problem/36076719

Reviewers: rsmith, t.p.northover

Reviewed By: rsmith

Subscribers: cfe-commits, jkorous-apple

Differential Revision: https://reviews.llvm.org/D41834

llvm-svn: 324419
2018-02-06 22:39:25 +00:00
..
Inputs
11-27-2007-FloatLiterals.c
asm-preproc-no-unicode.s
badstring_in_if0.c
bcpl-escaped-newline.c
block_cmt_end.c
builtin_redef.c
c90.c
case-insensitive-include-ms.c
case-insensitive-include-pr31836.sh
case-insensitive-include.c
case-insensitive-system-include.c
char-escapes.c
char-literal-encoding-error.c
char-literal.cpp
comment-escape.c
conflict-marker.c
constants.c
coroutines.cpp
counter.c
cross-windows-on-linux-default.cpp
cross-windows-on-linux.cpp
cxx-features.cpp Switch to gnu++14 as the default dialect. 2017-12-09 12:09:54 +00:00
cxx0x_keyword_as_cxx98.cpp
cxx0x_raw_string_delim_length.cpp
cxx0x_raw_string_directives.cpp
cxx0x_raw_string_unterminated.cpp
cxx1y_binary_literal.cpp
cxx1y_digit_separators.cpp [Lex] Fix handling numerical literals ending with ' and signed exponent. 2018-02-06 22:39:25 +00:00
cxx1z-trigraphs.cpp
cxx2a-spaceship.cpp [c++2a] P0515R3: Support for overloaded operator<=>. 2017-12-01 02:13:10 +00:00
cxx2a_keyword_as_cxx17.cpp
digraph.c
dollar-idents.c
eof-char.c
eof-conflict-marker.c
eof-file.c
eof-include.c
eof-number.c
eof-string.c
escape_newline.c
gnu-flags.c
half-literal.cpp Switch to gnu++14 as the default dialect. 2017-12-09 12:09:54 +00:00
has_attribute_objc_boxable.m
has_extension.c
has_extension_cxx.cpp
has_feature_address_sanitizer.cpp Hardware-assisted AddressSanitizer (clang part). 2017-12-09 01:32:07 +00:00
has_feature_boxed_nsvalue_expressions.m
has_feature_c1x.c
has_feature_cxx0x.cpp
has_feature_efficiency_sanitizer.cpp
has_feature_exceptions.cpp
has_feature_memory_sanitizer.cpp
has_feature_modules.m
has_feature_objc_arc.m
has_feature_rtti.cpp
has_feature_thread_sanitizer.cpp
has_feature_type_traits.cpp
header.cpp
hexfloat.cpp
keywords_test.c
keywords_test.cpp
long-long.cpp
modules-ts.cpp
ms-compatibility.c
ms-extensions.c
ms-extensions.cpp
msdos-cpm-eof.c
multiple-include.c
newline-eof-c++98-compat.cpp
newline-eof.c
newline-nul.c
null-character-in-literal.c [Lex] Avoid out-of-bounds dereference in LexAngledStringLiteral. 2018-01-12 18:54:35 +00:00
numeric-literal-trash.c
objc_macros.m
opencl-half-literal.cl
pragma-mark.c
pragma-message.c
pragma-message2.c
pragma-operators.cpp
pragma-region.c
preamble.c
preamble2.c
rdar-8914293.c
rdr-6096838-2.c
rdr-6096838.c
string-literal-encoding.c
string-literal-errors.cpp
string_concat.cpp
token-concat.c
token-concat.cpp
unicode-strings.c
unicode.c Warn if we find a Unicode homoglyph for a symbol in an identifier. 2017-12-14 13:15:08 +00:00
unknown-char.c
utf-16.c
utf-16.c.txt
utf8-char-literal.cpp
utf8-invalid.c
warn-date-time.c
warn_binary_literals.cpp
wchar-signedness.c
wchar.c Driver: hoist the `wchar_t` handling to the driver 2017-10-06 23:09:55 +00:00