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

Chris Lattner clattner at apple.com
Thu Jun 30 13:06:03 PDT 2011


On Jun 29, 2011, at 11:56 AM, Hans Wennborg wrote:

> 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

LGTM, please commit.

-Chris



More information about the cfe-commits mailing list