public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/arsenic/heads/analyzer_extension)] analyzer: Impose recursion limit on indirect calls.
@ 2021-08-25 7:07 Ankur saini
0 siblings, 0 replies; 2+ messages in thread
From: Ankur saini @ 2021-08-25 7:07 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:c846bf7b58d8c87548515b363d3cef5fc544e390
commit c846bf7b58d8c87548515b363d3cef5fc544e390
Author: Ankur Saini <arsenic@sourceware.org>
Date: Wed Aug 25 12:33:06 2021 +0530
analyzer: Impose recursion limit on indirect calls.
2021-08-25 Ankur Saini <arsenic@sourceware.org>
gcc/analyzer/ChangeLog:
PR analyzer/101980
* engine.cc (exploded_graph::maybe_create_dynamic_call): Don't create
calls if max recursion limit is reached.
Diff:
---
gcc/analyzer/engine.cc | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc
index 4ee92794941..9c604d1eb8c 100644
--- a/gcc/analyzer/engine.cc
+++ b/gcc/analyzer/engine.cc
@@ -3059,6 +3059,20 @@ exploded_graph::maybe_create_dynamic_call (const gcall *call,
new_point.push_to_call_stack (sn_exit,
next_point.get_supernode());
+
+ /* Impose a maximum recursion depth and don't analyze paths
+ that exceed it further.
+ This is something of a blunt workaround, but it only
+ applies to recursion (and mutual recursion), not to
+ general call stacks. */
+ if (new_point.get_call_string ().calc_recursion_depth ()
+ > param_analyzer_max_recursion_depth)
+ {
+ if (logger)
+ logger->log ("rejecting call edge: recursion limit exceeded");
+ return false;
+ }
+
next_state.push_call (*this, node, call, uncertainty);
if (next_state.m_valid)
^ permalink raw reply [flat|nested] 2+ messages in thread
* [gcc(refs/users/arsenic/heads/analyzer_extension)] analyzer: Impose recursion limit on indirect calls.
@ 2021-08-25 7:06 Ankur saini
0 siblings, 0 replies; 2+ messages in thread
From: Ankur saini @ 2021-08-25 7:06 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:dbea644f2efa053f335243083636115974fcc428
commit dbea644f2efa053f335243083636115974fcc428
Author: Ankur Saini <arsenic@sourceware.org>
Date: Wed Aug 25 12:33:06 2021 +0530
analyzer: Impose recursion limit on indirect calls.
2021-08-25 Ankur Saini <arsenic@sourceware.org>
gcc/analyzer/ChangeLog:
PR analyzer/101980
* engine.cc (exploded_graph::maybe_create_dynamic_call): Don't create
calls if max recursion limit is reached.
Diff:
---
gcc/analyzer/engine.cc | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc
index e66ca4e42fd..95f89fe9a73 100644
--- a/gcc/analyzer/engine.cc
+++ b/gcc/analyzer/engine.cc
@@ -3059,6 +3059,20 @@ exploded_graph::maybe_create_dynamic_call (const gcall *call,
new_point.push_to_call_stack (sn_exit,
next_point.get_supernode());
+
+ /* Impose a maximum recursion depth and don't analyze paths
+ that exceed it further.
+ This is something of a blunt workaround, but it only
+ applies to recursion (and mutual recursion), not to
+ general call stacks. */
+ if (new_point.get_call_string ().calc_recursion_depth ()
+ > param_analyzer_max_recursion_depth)
+ {
+ if (logger)
+ logger->log ("rejecting call edge: recursion limit exceeded");
+ return false;
+ }
+
next_state.push_call (*this, node, call, uncertainty);
if (next_state.m_valid)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-25 7:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-25 7:07 [gcc(refs/users/arsenic/heads/analyzer_extension)] analyzer: Impose recursion limit on indirect calls Ankur saini
-- strict thread matches above, loose matches on Subject: below --
2021-08-25 7:06 Ankur saini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).