Fixed some errors detected by PVS Studio

This commit is contained in:
Dávid Bolvanský 2021-10-09 17:27:41 +02:00
parent 3649fb14d1
commit 943b304848
5 changed files with 5 additions and 5 deletions

View File

@ -96,7 +96,7 @@ public:
return *this; return *this;
} }
ExecutorAddr operator++(int) { return ExecutorAddr(Addr++); } ExecutorAddr operator++(int) { return ExecutorAddr(Addr++); }
ExecutorAddr operator--(int) { return ExecutorAddr(Addr++); } ExecutorAddr operator--(int) { return ExecutorAddr(Addr--); }
ExecutorAddr &operator+=(const ExecutorAddrDiff Delta) { ExecutorAddr &operator+=(const ExecutorAddrDiff Delta) {
Addr += Delta.getValue(); Addr += Delta.getValue();

View File

@ -6061,7 +6061,7 @@ LegalizerHelper::LegalizeResult LegalizerHelper::lowerRotate(MachineInstr &MI) {
Register Src = MI.getOperand(1).getReg(); Register Src = MI.getOperand(1).getReg();
Register Amt = MI.getOperand(2).getReg(); Register Amt = MI.getOperand(2).getReg();
LLT DstTy = MRI.getType(Dst); LLT DstTy = MRI.getType(Dst);
LLT SrcTy = MRI.getType(Dst); LLT SrcTy = MRI.getType(Src);
LLT AmtTy = MRI.getType(Amt); LLT AmtTy = MRI.getType(Amt);
unsigned EltSizeInBits = DstTy.getScalarSizeInBits(); unsigned EltSizeInBits = DstTy.getScalarSizeInBits();

View File

@ -332,7 +332,7 @@ bool DWARFFormValue::extractValue(const DWARFDataExtractor &Data,
break; break;
case DW_FORM_LLVM_addrx_offset: case DW_FORM_LLVM_addrx_offset:
Value.uval = Data.getULEB128(OffsetPtr, &Err) << 32; Value.uval = Data.getULEB128(OffsetPtr, &Err) << 32;
Value.uval = Data.getU32(OffsetPtr, &Err); Value.uval |= Data.getU32(OffsetPtr, &Err);
break; break;
case DW_FORM_string: case DW_FORM_string:
Value.cstr = Data.getCStr(OffsetPtr, &Err); Value.cstr = Data.getCStr(OffsetPtr, &Err);

View File

@ -664,7 +664,7 @@ EHFrameEdgeFixer::readEncodedPointer(uint8_t PointerEncoding,
EffectiveType = (PointerSize == 8) ? DW_EH_PE_udata8 : DW_EH_PE_udata4; EffectiveType = (PointerSize == 8) ? DW_EH_PE_udata8 : DW_EH_PE_udata4;
JITTargetAddress Addr; JITTargetAddress Addr;
Edge::Kind PointerEdgeKind == Edge::Invalid; Edge::Kind PointerEdgeKind = Edge::Invalid;
switch (EffectiveType) { switch (EffectiveType) {
case DW_EH_PE_udata4: { case DW_EH_PE_udata4: {
uint32_t Val; uint32_t Val;

View File

@ -755,7 +755,7 @@ public:
} }
bool operator==(const BDVState &Other) const { bool operator==(const BDVState &Other) const {
return OriginalValue == OriginalValue && BaseValue == Other.BaseValue && return OriginalValue == Other.OriginalValue && BaseValue == Other.BaseValue &&
Status == Other.Status; Status == Other.Status;
} }