[PATCH] D136805: [NFC] Make format() more amenable to format attributes

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 1 11:44:13 PDT 2022


efriedma added a comment.

In D136805#3897947 <https://reviews.llvm.org/D136805#3897947>, @fcloutier wrote:

> In D136805#3887165 <https://reviews.llvm.org/D136805#3887165>, @efriedma wrote:
>
>>> since the undefined behavior was evaluated at build time, UBSan wouldn't catch it.
>>
>> Can you file a bug for this?  Opportunistic constant evaluation like that shouldn't bypass ubsan.
>
> I'm not able to reproduce the problem and my setup was janky, so I must have jumped to conclusions too fast after a tangential Godbolt test <https://godbolt.org/z/Y97b61nbx> shows that Clang will evaluate some UB at compile-time (with sanitizers disabled) where GCC won't. This example is probably happening in the back-end instead of the front-end. Sorry for the bad signal.

I managed to come up with a case similar to what you described: https://github.com/llvm/llvm-project/issues/58735 .  I think whether the issue triggers depends on how the result of the call is used.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136805



More information about the llvm-commits mailing list