diff options
Diffstat (limited to 'utils/TableGen/TGSourceMgr.cpp')
-rw-r--r-- | utils/TableGen/TGSourceMgr.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/utils/TableGen/TGSourceMgr.cpp b/utils/TableGen/TGSourceMgr.cpp index 9c39230def..e4d1c40dc6 100644 --- a/utils/TableGen/TGSourceMgr.cpp +++ b/utils/TableGen/TGSourceMgr.cpp @@ -28,7 +28,9 @@ TGSourceMgr::~TGSourceMgr() { int TGSourceMgr::FindBufferContainingLoc(TGLoc Loc) const { for (unsigned i = 0, e = Buffers.size(); i != e; ++i) if (Loc.getPointer() >= Buffers[i].Buffer->getBufferStart() && - Loc.getPointer() < Buffers[i].Buffer->getBufferEnd()) + // Use <= here so that a pointer to the null at the end of the buffer + // is included as part of the buffer. + Loc.getPointer() <= Buffers[i].Buffer->getBufferEnd()) return i; return -1; } |