[PATCH] D113164: [NFC] Avoid nullptr dereference

Freddy, Ye via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 3 23:00:10 PDT 2021


FreddyYe updated this revision to Diff 384668.
FreddyYe added a comment.

changed into assert()


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113164/new/

https://reviews.llvm.org/D113164

Files:
  llvm/lib/CodeGen/TypePromotion.cpp


Index: llvm/lib/CodeGen/TypePromotion.cpp
===================================================================
--- llvm/lib/CodeGen/TypePromotion.cpp
+++ llvm/lib/CodeGen/TypePromotion.cpp
@@ -204,6 +204,7 @@
 }
 
 bool TypePromotion::LessOrEqualTypeSize(Value *V) {
+  assert(!V);
   return V->getType()->getScalarSizeInBits() <= TypeSize;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113164.384668.patch
Type: text/x-patch
Size: 345 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211104/cd930209/attachment.bin>


More information about the llvm-commits mailing list