| 766 | } |
| 767 | |
| 768 | static bool has_nullptr(const Value *v) { |
| 769 | if (dynamic_cast<const NullPointerValue*>(v) || |
| 770 | (dynamic_cast<const UndefValue*>(v) && hasPtr(v->getType()))) |
| 771 | // undef pointer points to the nullblk |
| 772 | return true; |
| 773 | |
| 774 | if (auto agg = dynamic_cast<const AggregateValue*>(v)) { |
| 775 | for (auto val : agg->getVals()) { |
| 776 | if (has_nullptr(val)) |
| 777 | return true; |
| 778 | } |
| 779 | } |
| 780 | |
| 781 | return false; |
| 782 | } |
| 783 | |
| 784 | static unsigned num_ptrs(const Type &ty) { |
| 785 | unsigned n = ty.isPtrType(); |
no test coverage detected