[pseudo] fix an out-of-bound error in LRTable.
authorHaojian Wu <hokein.wu@gmail.com>
Wed, 23 Feb 2022 20:34:20 +0000 (21:34 +0100)
committerHaojian Wu <hokein.wu@gmail.com>
Wed, 23 Feb 2022 20:34:54 +0000 (21:34 +0100)
Fix window debug build.

clang/lib/Tooling/Syntax/Pseudo/LRTable.cpp

index 4a817a5..23c4559 100644 (file)
@@ -117,7 +117,7 @@ llvm::ArrayRef<LRTable::Action> LRTable::find(StateID Src, SymbolID ID) const {
   size_t Start = It - States.data(), End = Start;
   while (End < States.size() && States[End] == Src)
     ++End;
-  return llvm::makeArrayRef(&Actions[Start], &Actions[End]);
+  return llvm::makeArrayRef(&Actions[Start], End - Start);
 }
 
 } // namespace pseudo