[PATCH] D131979: [clang][UBSan] Fix __builtin_assume_aligned crash
John McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 31 11:55:18 PDT 2022
rjmccall added inline comments.
================
Comment at: clang/lib/Sema/SemaChecking.cpp:7671
+ AllArgs, CallType))
+ return true;
+
----------------
yihanaa wrote:
> rjmccall wrote:
> > You can just pull the argument expressions out of the `CallExpr`; you don't need to call `GatherArgumentsForCall`.
> > You can just pull the argument expressions out of the `CallExpr`; you don't need to call `GatherArgumentsForCall`.
>
> This GatherArgumentsForCall was used to do the common sema checking and emit warning, like './main.cpp:5:40: warning: passing 'volatile char *' to parameter of type 'const void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]' hahaha, for this is a common case, I also think GatherArgumentsForCall is not a good choice
> , so I try to find a replacement, e.g. ImpCastExprToType or other ways, what do you think about?
`convertArgumentToType` should trigger any useful warnings in the second and third arguments. For the first, I don't actually think there are any warnings we care about.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131979/new/
https://reviews.llvm.org/D131979
More information about the cfe-commits
mailing list