gcc/analyzer/ChangeLog:
PR analyzer/97029
* analyzer.cc (is_setjmp_call_p): Require the initial arg to be a
pointer.
* region-model.cc (region_model::deref_rvalue): Assert that the
svalue is of pointer type.
gcc/testsuite/ChangeLog:
* gcc.dg/analyzer/pr97029.c: New test.
{
if (is_special_named_call_p (call, "setjmp", 1)
|| is_special_named_call_p (call, "sigsetjmp", 2))
- return true;
+ /* region_model::on_setjmp requires a pointer. */
+ if (POINTER_TYPE_P (TREE_TYPE (gimple_call_arg (call, 0))))
+ return true;
return false;
}
/* Get a region for referencing PTR_SVAL, creating a region if need be, and
potentially generating warnings via CTXT.
+ PTR_SVAL must be of pointer type.
PTR_TREE if non-NULL can be used when emitting diagnostics. */
const region *
region_model_context *ctxt)
{
gcc_assert (ptr_sval);
+ gcc_assert (POINTER_TYPE_P (ptr_sval->get_type ()));
/* If we're dereferencing PTR_SVAL, assume that it is non-NULL; add this
as a constraint. This suppresses false positives from
--- /dev/null
+struct vj {};
+
+void
+setjmp (struct vj pl)
+{
+ setjmp (pl);
+}