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

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 15 11:16:05 PDT 2022


aaron.ballman added inline comments.


================
Comment at: clang/test/Sema/builtin-redecl.cpp:5-6
 
+#include <stddef.h>
+
 // Redeclaring library builtins is OK.
----------------
yronglin wrote:
> 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? 
Oh good catch, I had missed the `-x c` on a RUN line and was looking at the file extension alone. :-) We can't use that typedef because there are some platforms where that type is wrong, but we can be tricky in a different way: `typedef __typeof__(sizeof(0)) size_t;`


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