From: Craig Topper Date: Fri, 27 Aug 2021 19:30:31 +0000 (-0700) Subject: [RISCV] Use ~0ULL instead of ~0U when checking for invalid ErrorInfo. X-Git-Tag: upstream/15.0.7~32826 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dbf0d8118ccbfd09def0974bf671c39e94d0be93;p=platform%2Fupstream%2Fllvm.git [RISCV] Use ~0ULL instead of ~0U when checking for invalid ErrorInfo. ErrorInfo is a uint64_t and is initialized to all 1s. Not sure how to test this. Noticed while working on .insn support. --- diff --git a/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp b/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp index b2683d5..c3ccec1 100644 --- a/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp +++ b/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp @@ -1002,7 +1002,7 @@ bool RISCVAsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode, } case Match_InvalidOperand: { SMLoc ErrorLoc = IDLoc; - if (ErrorInfo != ~0U) { + if (ErrorInfo != ~0ULL) { if (ErrorInfo >= Operands.size()) return Error(ErrorLoc, "too few operands for instruction"); @@ -1019,7 +1019,7 @@ bool RISCVAsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode, // corresponding operand is missing. if (Result > FIRST_TARGET_MATCH_RESULT_TY) { SMLoc ErrorLoc = IDLoc; - if (ErrorInfo != ~0U && ErrorInfo >= Operands.size()) + if (ErrorInfo != ~0ULL && ErrorInfo >= Operands.size()) return Error(ErrorLoc, "too few operands for instruction"); }