[clang] [-Wunsafe-buffer-usage] Warning Libc functions (PR #101583)

Ziqing Luo via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 6 13:00:48 PDT 2024


ziqingluo-90 wrote:

> > We're seeing a crash with this patch when compiling with -Weverything.
> > ```
> > clang: ../../clang/include/clang/AST/Expr.h:3026: const clang::Expr *clang::CallExpr::getArg(unsigned int) const: Assertion `Arg < getNumArgs() && "Arg access out of range!"' failed.
> > ```
> > 
> > 
> >     
> >       
> >     
> > 
> >       
> >     
> > 
> >     
> >   
> > I'm working on extracting a reproducer.
> 
> `clang -c -Weverything bbi-98867.c` with bbi-98867.c being just
> 
> ```
> void printf() { printf(); }
> ```
> 
> (I've creduced the reproducer, I can't share the full one)

Thanks for finding the bug and making a reproducer.  It has been fixed in de88d7db7b77141297fbb5638ee1e18d1fba53b8.

https://github.com/llvm/llvm-project/pull/101583


More information about the cfe-commits mailing list