[PATCH] D128644: [RISCV] Fix the problem of parsing long version numbers

Shao-Ce SUN via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 27 07:07:53 PDT 2022


sunshaoce created this revision.
sunshaoce added reviewers: kito-cheng, asb, luismarques, craig.topper, jrtc27.
Herald added subscribers: VincentWu, luke957, StephenFan, vkmr, frasercrmck, evandro, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, shiva0217, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya, arichardson.
Herald added a project: All.
sunshaoce requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.

For example, when parsing Zbpbo0p911, an error will be reported: 
"multi-character extensions must be separated by underscores"


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D128644

Files:
  llvm/lib/Support/RISCVISAInfo.cpp


Index: llvm/lib/Support/RISCVISAInfo.cpp
===================================================================
--- llvm/lib/Support/RISCVISAInfo.cpp
+++ llvm/lib/Support/RISCVISAInfo.cpp
@@ -348,7 +348,7 @@
 
   if (!MajorStr.empty() && In.consume_front("p")) {
     MinorStr = In.take_while(isDigit);
-    In = In.substr(MajorStr.size() + 1);
+    In = In.substr(MajorStr.size() + MinorStr.size() - 1);
 
     // Expected 'p' to be followed by minor version number.
     if (MinorStr.empty()) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128644.440212.patch
Type: text/x-patch
Size: 494 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220627/4893f5f7/attachment.bin>


More information about the llvm-commits mailing list