aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorScott Linder <Scott.Linder@amd.com>2020-12-09 23:13:15 +0000
committerScott Linder <Scott.Linder@amd.com>2020-12-09 23:39:32 +0000
commit19c56e11fa489cfc461b9ea10faa68e5a1f3eca1 (patch)
treee2e47bc8e3f73cb52e24ad811e88ce71b5663438 /clang/lib/Frontend/CompilerInvocation.cpp
parentd1e0545445ced928ae4f0437997278e09cefde1d (diff)
downloadllvm-19c56e11fa489cfc461b9ea10faa68e5a1f3eca1.zip
llvm-19c56e11fa489cfc461b9ea10faa68e5a1f3eca1.tar.gz
llvm-19c56e11fa489cfc461b9ea10faa68e5a1f3eca1.tar.bz2
[MC] Fix ICE with non-newline terminated input
There is an explicit option for the lexer to support this, but we crash when `-preserve-comments` is enabled because it checks for `getTok().getString().empty()` to detect the case. This doesn't work currently because the lexer reports this case as a string of length 1, containing a null byte. Change the lexer to instead report this case via an empty string, as the null terminator isn't logically a part of the textual input, and the check for `.empty()` seems natural and obvious in the calling code. Reviewed By: niravd Differential Revision: https://reviews.llvm.org/D92681
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions