[PATCH] D108123: [Local] Move isFreeCall() before willReturn()

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 16 06:15:21 PDT 2021


lebedev.ri added a comment.

In D108123#2946733 <https://reviews.llvm.org/D108123#2946733>, @guopeilin wrote:

> In D108123#2946665 <https://reviews.llvm.org/D108123#2946665>, @lebedev.ri wrote:
>
>> This test already passes without the code change: https://godbolt.org/z/48TnbeKj1
>
> The store is not expected, which will become unreachable after SimplifyCFG.

Right, but that is the correct outcome.
Why is it not UB to free an `undef` (a.k.a. any random pointer)?
That is correct as per the current langref: https://alive2.llvm.org/ce/z/jBqe-E

Also, i would like to note that the patch's description doesn't mention that this wants to make `free(undef)` non-UB.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108123



More information about the llvm-commits mailing list