llvm.org GIT mirror llvm / 8ab0c06
[RISCV] Replace incorrect use of sizeof with array_lengthof RISCVDisassembler was incorrectly using sizeof(Arr) when it should have used sizeof(Arr)/sizeof(Arr[0]). Update to use array_lengthof instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356035 91177308-0d34-0410-b5e6-96231b3b80d8 Alex Bradbury 1 year, 8 months ago
1 changed file(s) with 3 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
6868 static DecodeStatus DecodeGPRRegisterClass(MCInst &Inst, uint64_t RegNo,
6969 uint64_t Address,
7070 const void *Decoder) {
71 if (RegNo > sizeof(GPRDecoderTable))
71 if (RegNo > array_lengthof(GPRDecoderTable))
7272 return MCDisassembler::Fail;
7373
7474 // We must define our own mapping from RegNo to register identifier.
9393 static DecodeStatus DecodeFPR32RegisterClass(MCInst &Inst, uint64_t RegNo,
9494 uint64_t Address,
9595 const void *Decoder) {
96 if (RegNo > sizeof(FPR32DecoderTable))
96 if (RegNo > array_lengthof(FPR32DecoderTable))
9797 return MCDisassembler::Fail;
9898
9999 // We must define our own mapping from RegNo to register identifier.
129129 static DecodeStatus DecodeFPR64RegisterClass(MCInst &Inst, uint64_t RegNo,
130130 uint64_t Address,
131131 const void *Decoder) {
132 if (RegNo > sizeof(FPR64DecoderTable))
132 if (RegNo > array_lengthof(FPR64DecoderTable))
133133 return MCDisassembler::Fail;
134134
135135 // We must define our own mapping from RegNo to register identifier.