[cfe-commits] [Patch] Fix off-by-one error in StringLiteral::getLocationOfByte, PR10223

Hans Wennborg hans at chromium.org
Wed Jun 29 11:56:51 PDT 2011


The attached patch fixes an off-by-one error in
StringLiteral::getLocationOfByte, exposed by PR10223.

I don't really know what's going on in this code, so it would be good
if someone could review.

It seems that TokNo == getNumConcatenated() would never be true,
because it's asserted earlier that TokNo < getNumConcatenated(). I
assume the author's intention was "TokNo is the last token", i.e.
TokNo == getNumConcatenated() - 1

Thanks,
Hans
-------------- next part --------------
A non-text attachment was scrubbed...
Name: get-location-of-byte.patch
Type: text/x-patch
Size: 1056 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110629/73314a44/attachment.bin>


More information about the cfe-commits mailing list