diff options
author | Kazu Hirata <kazu@google.com> | 2022-06-20 10:38:12 -0700 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-06-20 10:38:12 -0700 |
commit | e0e687a615c1fdb6ba034fc2e48b0834a372706f (patch) | |
tree | 79455a1fe4a3d455cbd304ca0c7c77dde47e1f61 /llvm/lib/CodeGen/StackProtector.cpp | |
parent | e363c5963dc3ad5d9492d3f37055ad56a84411a5 (diff) | |
download | llvm-e0e687a615c1fdb6ba034fc2e48b0834a372706f.zip llvm-e0e687a615c1fdb6ba034fc2e48b0834a372706f.tar.gz llvm-e0e687a615c1fdb6ba034fc2e48b0834a372706f.tar.bz2 |
[llvm] Don't use Optional::hasValue (NFC)
Diffstat (limited to 'llvm/lib/CodeGen/StackProtector.cpp')
-rw-r--r-- | llvm/lib/CodeGen/StackProtector.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/StackProtector.cpp b/llvm/lib/CodeGen/StackProtector.cpp index ea950da..510a8e3 100644 --- a/llvm/lib/CodeGen/StackProtector.cpp +++ b/llvm/lib/CodeGen/StackProtector.cpp @@ -167,7 +167,7 @@ bool StackProtector::HasAddressTaken(const Instruction *AI, // If this instruction accesses memory make sure it doesn't access beyond // the bounds of the allocated object. Optional<MemoryLocation> MemLoc = MemoryLocation::getOrNone(I); - if (MemLoc.hasValue() && MemLoc->Size.hasValue() && + if (MemLoc && MemLoc->Size.hasValue() && !TypeSize::isKnownGE(AllocSize, TypeSize::getFixed(MemLoc->Size.getValue()))) return true; |