[PATCH] D65408: [Attributor] Heap-To-Stack Conversion

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 15 15:15:10 PDT 2019


xbolva00 added a comment.

IsMallocLikeFn returns true for C++ operator new which does throw on an allocation failure.

So probably you stackify:

int *p = new int;
free(p);

It is a stupid code and buggy, but please add it as test case and the following fix:

For now, just check if (isMallocLike && !isOpNewLike).

I think it is worth to add support for c++’s new - delete pairs in the future..


Repository:
  rL LLVM

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

https://reviews.llvm.org/D65408





More information about the llvm-commits mailing list