aboutsummaryrefslogtreecommitdiff
path: root/gcc/analyzer/region-model.h
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2020-09-21 11:59:26 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2020-09-21 18:50:08 -0400
commit1e19ecd79b45af6df87a6869d1936b857c9f71fc (patch)
tree1964506c67511ce7de835f3315e163032f1bae3d /gcc/analyzer/region-model.h
parent15e7b93ba4256884c90198c678ed7eded4e73464 (diff)
downloadgcc-1e19ecd79b45af6df87a6869d1936b857c9f71fc.zip
gcc-1e19ecd79b45af6df87a6869d1936b857c9f71fc.tar.gz
gcc-1e19ecd79b45af6df87a6869d1936b857c9f71fc.tar.bz2
analyzer: fix ICE on bogus decl of memset [PR97130]
Verify that arguments are pointers before calling handling code that calls deref_rvalue on them. gcc/analyzer/ChangeLog: PR analyzer/97130 * region-model-impl-calls.cc (call_details::get_arg_type): New. * region-model.cc (region_model::on_call_pre): Check that the initial arg is a pointer before calling impl_call_memset and impl_call_strlen. * region-model.h (call_details::get_arg_type): New decl. gcc/testsuite/ChangeLog: PR analyzer/97130 * gcc.dg/analyzer/pr97130.c: New test.
Diffstat (limited to 'gcc/analyzer/region-model.h')
-rw-r--r--gcc/analyzer/region-model.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/analyzer/region-model.h b/gcc/analyzer/region-model.h
index 1bb9798..4859df3 100644
--- a/gcc/analyzer/region-model.h
+++ b/gcc/analyzer/region-model.h
@@ -2482,6 +2482,7 @@ public:
bool maybe_set_lhs (const svalue *result) const;
tree get_arg_tree (unsigned idx) const;
+ tree get_arg_type (unsigned idx) const;
const svalue *get_arg_svalue (unsigned idx) const;
void dump_to_pp (pretty_printer *pp, bool simple) const;