File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -518,19 +518,21 @@ void static_analysis_baset::do_function_call_rec(
518
518
}
519
519
return ;
520
520
}
521
-
521
+
522
522
if (function.id ()==ID_symbol)
523
523
{
524
524
const irep_idt &identifier=function.get (ID_identifier);
525
525
526
- if (recursion_set. find (identifier)!=recursion_set. end () )
526
+ if (ignore_recursion )
527
527
{
528
- // recursion detected!
529
- return ;
528
+ if (recursion_set.find (identifier)!=recursion_set.end ())
529
+ {
530
+ // recursion detected!
531
+ return ;
532
+ }
533
+ else
534
+ recursion_set.insert (identifier);
530
535
}
531
- else
532
- recursion_set.insert (identifier);
533
-
534
536
goto_functionst::function_mapt::const_iterator it=
535
537
goto_functions.function_map .find (identifier);
536
538
@@ -544,7 +546,8 @@ void static_analysis_baset::do_function_call_rec(
544
546
arguments,
545
547
new_state);
546
548
547
- recursion_set.erase (identifier);
549
+ if (ignore_recursion)
550
+ recursion_set.erase (identifier);
548
551
}
549
552
else if (function.id ()==ID_if)
550
553
{
Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ class static_analysis_baset
98
98
ns(_ns),
99
99
initialized(false )
100
100
{
101
+ ignore_recursion=get_ignore_recursion ();
101
102
}
102
103
103
104
virtual void initialize (
@@ -260,6 +261,10 @@ class static_analysis_baset
260
261
locationt l,
261
262
const exprt &expr,
262
263
std::list<exprt> &dest)=0;
264
+
265
+ bool ignore_recursion;
266
+ virtual bool get_ignore_recursion () { return true ; }
267
+
263
268
};
264
269
265
270
// T is expected to be derived from domain_baset
You can’t perform that action at this time.
0 commit comments