[llvm] 13e3bde - [RISCV] Correct end pointer in RISCVAsmParser::parseGPRAsFPR.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 29 18:47:04 PST 2023
Author: Craig Topper
Date: 2023-01-29T18:46:39-08:00
New Revision: 13e3bdef3bc2e1d222aa26f77c7219419ecb7eaf
URL: https://github.com/llvm/llvm-project/commit/13e3bdef3bc2e1d222aa26f77c7219419ecb7eaf
DIFF: https://github.com/llvm/llvm-project/commit/13e3bdef3bc2e1d222aa26f77c7219419ecb7eaf.diff
LOG: [RISCV] Correct end pointer in RISCVAsmParser::parseGPRAsFPR.
Instead of using start pointer - 1, use start pointer + length of
the name string.
Added:
Modified:
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp b/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
index 54358863fdbb..a3d84323b955 100644
--- a/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
+++ b/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
@@ -1832,7 +1832,7 @@ OperandMatchResultTy RISCVAsmParser::parseGPRAsFPR(OperandVector &Operands) {
if (RegNo == RISCV::NoRegister)
return MatchOperand_NoMatch;
SMLoc S = getLoc();
- SMLoc E = SMLoc::getFromPointer(S.getPointer() - 1);
+ SMLoc E = SMLoc::getFromPointer(S.getPointer() + Name.size());
getLexer().Lex();
Operands.push_back(RISCVOperand::createReg(
RegNo, S, E, isRV64(), !getSTI().hasFeature(RISCV::FeatureStdExtF)));
More information about the llvm-commits
mailing list