]> granicus.if.org Git - clang/commit
[Lexer] NFC: Fix an off-by-one bug in getAsCharRange().
authorArtem Dergachev <artem.dergachev@gmail.com>
Fri, 5 Apr 2019 21:48:52 +0000 (21:48 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Fri, 5 Apr 2019 21:48:52 +0000 (21:48 +0000)
commit4c9a6a16bb14b5d8a5e89234c3199f771b9350d4
treebeaf58e648f2a37d317dfcff28f24d1e38ba2f21
parent034cb642794db0f03114ba07d0aed328a23b3b2f
[Lexer] NFC: Fix an off-by-one bug in getAsCharRange().

As the unit test demonstrates, subtracting 1 from the offset was unnecessary.

The only user of this function was the plist file emitter (in Static Analyzer
and ARCMigrator). It means that a lot of Static Analyzer's plist arrows
are in fact off by one character. The patch carefully preserves this
completely incorrect behavior and causes no functional change,
i.e. no plist format breakage.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357823 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/PlistSupport.h
include/clang/Lex/Lexer.h
unittests/Lex/LexerTest.cpp