[PATCH] D151716: [RISCV] check pointer before dereference

Wang Pengcheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 30 20:23:51 PDT 2023


pcwang-thead added inline comments.


================
Comment at: llvm/lib/Support/RISCVISAInfo.cpp:705
     I += 1 + ConsumeLength;
-    if (*I == '_')
+    if (I != E && *I == '_')
       ++I;
----------------
What about:
```
  auto GoToNextExt = [&](StringRef::iterator &I, unsigned ConsumeLength) {
    I += 1 + ConsumeLength;
    if (I != Exts.end() && *I == '_')
      ++I;
  };
```
So that there is no need to make changes below.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151716/new/

https://reviews.llvm.org/D151716



More information about the llvm-commits mailing list