[PATCH] D52224: [Xray] llvm-xray fix possible segfault

David CARLIER via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 18 03:08:12 PDT 2018


devnexen added inline comments.


================
Comment at: tools/llvm-xray/xray-account.cpp:362
+  if (AccountTop > 0) {
+    auto MaxTop = std::min(AccountTop.getValue(), static_cast<int>(Results.end() - Results.begin()));
+    Results.erase(Results.begin() + MaxTop, Results.end());
----------------
dberris wrote:
> Why not use `Results.size()` ?
True :)


Repository:
  rL LLVM

https://reviews.llvm.org/D52224





More information about the llvm-commits mailing list