On Mon, Jan 27, 2020 at 09:09:37PM -0500, David Malcolm wrote:
> > Please see calls.c (special_function_p), you should treat certainly
> > also sigsetjmp as a setjmp call, and similarly to special_function_p,
> > skip over _ or __ prefixes before the setjmp or sigsetjmp name.
> > Similarly for longjmp/siglongjmp.
> 
> This patch refactors some code in special_function_p that checks for
> the function being sane to match by name, splitting it out into a new
> maybe_special_function_p, and using it it two places in the analyzer.
> 
> Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu;
> OK for master?

Not sure it is worth it to factor out the
      DECL_NAME (fndecl)
      && (DECL_CONTEXT (fndecl) == NULL_TREE
          || TREE_CODE (DECL_CONTEXT (fndecl)) == TRANSLATION_UNIT_DECL)
      && TREE_PUBLIC (fndecl)
check, that seems like simple enough that it could be duplicated.
And, even if there is a strong reason not to, at least it ought to be
defined inline in the header, not everyone will use LTO and without LTO it
will need to be an out of line call.
Ack on removing the fndecl && check from special_function_p, the callers
ensure it is non-NULL already, and even if they didn't, after the if (fndecl
&& ...) guarded if there is unconditional dereferencing of fndecl.

        Jakub

Reply via email to