[llvm] 943b304 - Fixed some errors detected by PVS Studio
Dávid Bolvanský via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 9 08:27:47 PDT 2021
Author: Dávid Bolvanský
Date: 2021-10-09T17:27:41+02:00
New Revision: 943b3048484b7e3cf04f4d51c23c82fcece2185d
URL: https://github.com/llvm/llvm-project/commit/943b3048484b7e3cf04f4d51c23c82fcece2185d
DIFF: https://github.com/llvm/llvm-project/commit/943b3048484b7e3cf04f4d51c23c82fcece2185d.diff
LOG: Fixed some errors detected by PVS Studio
Added:
Modified:
llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
llvm/lib/ExecutionEngine/JITLink/EHFrameSupport.cpp
llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h
index ddbb702545a96..6b795799a961f 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h
@@ -96,7 +96,7 @@ class ExecutorAddr {
return *this;
}
ExecutorAddr operator++(int) { return ExecutorAddr(Addr++); }
- ExecutorAddr operator--(int) { return ExecutorAddr(Addr++); }
+ ExecutorAddr operator--(int) { return ExecutorAddr(Addr--); }
ExecutorAddr &operator+=(const ExecutorAddrDiff Delta) {
Addr += Delta.getValue();
diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
index 0ecb2d184b3c6..c74bec7dfc0d3 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
@@ -6061,7 +6061,7 @@ LegalizerHelper::LegalizeResult LegalizerHelper::lowerRotate(MachineInstr &MI) {
Register Src = MI.getOperand(1).getReg();
Register Amt = MI.getOperand(2).getReg();
LLT DstTy = MRI.getType(Dst);
- LLT SrcTy = MRI.getType(Dst);
+ LLT SrcTy = MRI.getType(Src);
LLT AmtTy = MRI.getType(Amt);
unsigned EltSizeInBits = DstTy.getScalarSizeInBits();
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp b/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
index a03446b13d948..c4e479191a692 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
@@ -332,7 +332,7 @@ bool DWARFFormValue::extractValue(const DWARFDataExtractor &Data,
break;
case DW_FORM_LLVM_addrx_offset:
Value.uval = Data.getULEB128(OffsetPtr, &Err) << 32;
- Value.uval = Data.getU32(OffsetPtr, &Err);
+ Value.uval |= Data.getU32(OffsetPtr, &Err);
break;
case DW_FORM_string:
Value.cstr = Data.getCStr(OffsetPtr, &Err);
diff --git a/llvm/lib/ExecutionEngine/JITLink/EHFrameSupport.cpp b/llvm/lib/ExecutionEngine/JITLink/EHFrameSupport.cpp
index cb2b8592ebc9d..c1741dde00a6a 100644
--- a/llvm/lib/ExecutionEngine/JITLink/EHFrameSupport.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/EHFrameSupport.cpp
@@ -664,7 +664,7 @@ EHFrameEdgeFixer::readEncodedPointer(uint8_t PointerEncoding,
EffectiveType = (PointerSize == 8) ? DW_EH_PE_udata8 : DW_EH_PE_udata4;
JITTargetAddress Addr;
- Edge::Kind PointerEdgeKind == Edge::Invalid;
+ Edge::Kind PointerEdgeKind = Edge::Invalid;
switch (EffectiveType) {
case DW_EH_PE_udata4: {
uint32_t Val;
diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
index 415269db0f9bc..e5950d8ee1ce9 100644
--- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
+++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
@@ -755,7 +755,7 @@ class BDVState {
}
bool operator==(const BDVState &Other) const {
- return OriginalValue == OriginalValue && BaseValue == Other.BaseValue &&
+ return OriginalValue == Other.OriginalValue && BaseValue == Other.BaseValue &&
Status == Other.Status;
}
More information about the llvm-commits
mailing list