aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorShao-Ce SUN <sunshaoce@iscas.ac.cn>2022-06-28 11:30:53 +0800
committerShao-Ce SUN <sunshaoce@iscas.ac.cn>2022-06-28 11:48:14 +0800
commit1919adb19b4a0aeaef7f3b75a90062166b58b261 (patch)
tree79127f433e51fa36e20f2f0f842363772bd8d653 /llvm/lib
parent17a36c7c40e99aa28d4323698f69845d92d96682 (diff)
downloadllvm-1919adb19b4a0aeaef7f3b75a90062166b58b261.zip
llvm-1919adb19b4a0aeaef7f3b75a90062166b58b261.tar.gz
llvm-1919adb19b4a0aeaef7f3b75a90062166b58b261.tar.bz2
[RISCV] Fix the problem of parsing long version numbers
For example, when parsing Zbpbo0p911, an error will be reported: "multi-character extensions must be separated by underscores" Reviewed By: asb Differential Revision: https://reviews.llvm.org/D128644
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Support/RISCVISAInfo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/RISCVISAInfo.cpp b/llvm/lib/Support/RISCVISAInfo.cpp
index 6b2614d..1057dba 100644
--- a/llvm/lib/Support/RISCVISAInfo.cpp
+++ b/llvm/lib/Support/RISCVISAInfo.cpp
@@ -348,7 +348,7 @@ static Error getExtensionVersion(StringRef Ext, StringRef In, unsigned &Major,
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()) {