[PATCH] D133583: [clang][ubsan] Fix __builtin_assume_aligned incorrect type descriptor and C++ object polymorphic address

Lin Yurong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 15 10:41:01 PDT 2022


yronglin added a comment.

In D133583#3792625 <https://reviews.llvm.org/D133583#3792625>, @aaron.ballman wrote:

> In D133583#3780460 <https://reviews.llvm.org/D133583#3780460>, @yronglin wrote:
>
>> Hi, follow D133202 <https://reviews.llvm.org/D133202> , should I both fix alignment in this patch or in another separate patch? (this seems have different behavior with gcc https://godbolt.org/z/7dvM8zhnh )
>
> I think that's a separate patch -- this one is fixing a mistake with the type-checking related crash fix and the other is about the behavior of the expression itself when it's valid.
>
> The current patch looks reasonable to me, but I'd love a second opinion.

Thanks for your comments @aaron.ballman



================
Comment at: clang/test/Sema/builtin-redecl.cpp:5-6
 
+#include <stddef.h>
+
 // Redeclaring library builtins is OK.
----------------
aaron.ballman wrote:
> We can be tricky instead of including a header file.
Use `decltype` not works in C , can we use `typedef unsigned long size_t `instead? 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133583



More information about the cfe-commits mailing list