[PATCH] D33305: [ubsan] Add a check for pointer overflow UB

John Regehr via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 7 08:27:15 PDT 2017


regehr added a comment.

I'm taking a look. For reference here's the test program I'm using.

  #include <stddef.h>
  
  typedef struct {
    int x[2];
  } T;
  
  int main(void) {
    T f;
    T *p = &f;
    ptrdiff_t d = -3293184;
    p += d / sizeof(T);
    return 0;
  }


Repository:
  rL LLVM

https://reviews.llvm.org/D33305





More information about the cfe-commits mailing list