[PATCH] D47894: [clang]: Add support for "-fno-delete-null-pointer-checks"

Dávid Bolvanský via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 7 15:10:32 PDT 2018


xbolva00 added a comment.

In https://reviews.llvm.org/D47894#1125653, @efriedma wrote:

> The problem would come from propagating nonnull-ness from something which isn't inherently nonnull.  For example, strlen has a nonnull argument, so `strlen(NULL)` is UB, therefore given `int z = strlen(x); if (x) {...}`, we can remove the null check.  (Not sure we actually do this transform at the moment, but it's something we could do in the future.)


This is interesting. Extra pass for such transformation? or any better place for it?


Repository:
  rC Clang

https://reviews.llvm.org/D47894





More information about the cfe-commits mailing list