summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2020-01-11 14:36:46 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2020-01-11 14:37:19 +0000
commita8ed86b5c705cf1d2f3ca55b0640cf0f2fe01abc (patch)
tree57dca8e2349be09214f1abfa0b1213ec09044e6d
parent24763734e7f45e3b60118b28987685d42e7a761f (diff)
downloadbcm5719-llvm-a8ed86b5c705cf1d2f3ca55b0640cf0f2fe01abc.tar.gz
bcm5719-llvm-a8ed86b5c705cf1d2f3ca55b0640cf0f2fe01abc.zip
moveOperands - assert Src/Dst MachineOperands are non-null.
Fixes static-analyzer warnings.
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index c8e3e5bb01a..08d786f8f12 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -187,8 +187,8 @@ static void moveOperands(MachineOperand *Dst, MachineOperand *Src,
unsigned NumOps, MachineRegisterInfo *MRI) {
if (MRI)
return MRI->moveOperands(Dst, Src, NumOps);
-
// MachineOperand is a trivially copyable type so we can just use memmove.
+ assert(Dst && Src && "Unknown operands");
std::memmove(Dst, Src, NumOps * sizeof(MachineOperand));
}
OpenPOWER on IntegriCloud