@@ -17,6 +17,8 @@ Author: Daniel Kroening, kroening@kroening.com
1717
1818#include < util/source_location.h>
1919#include < util/simplify_expr.h>
20+ #include < util/string_utils.h>
21+ #include < util/string2int.h>
2022
2123symex_bmct::symex_bmct (
2224 message_handlert &mh,
@@ -25,8 +27,6 @@ symex_bmct::symex_bmct(
2527 path_storaget &path_storage)
2628 : goto_symext(mh, outer_symbol_table, _target, path_storage),
2729 record_coverage(false ),
28- max_unwind(0 ),
29- max_unwind_is_set(false ),
3030 symex_coverage(ns)
3131{
3232}
@@ -131,25 +131,12 @@ bool symex_bmct::get_unwind(
131131 // / --unwind options to decide:
132132 if (abort_unwind_decision.is_unknown ())
133133 {
134- // We use the most specific limit we have,
135- // and 'infinity' when we have none.
134+ auto limit=unwindset.get_limit (id, source.thread_nr );
136135
137- loop_limitst &this_thread_limits=
138- thread_loop_limits[source.thread_nr ];
139-
140- loop_limitst::const_iterator l_it=this_thread_limits.find (id);
141- if (l_it!=this_thread_limits.end ())
142- this_loop_limit=l_it->second ;
136+ if (limit.has_value ())
137+ abort_unwind_decision = tvt (false );
143138 else
144- {
145- l_it=loop_limits.find (id);
146- if (l_it!=loop_limits.end ())
147- this_loop_limit=l_it->second ;
148- else if (max_unwind_is_set)
149- this_loop_limit=max_unwind;
150- }
151-
152- abort_unwind_decision = tvt (unwind >= this_loop_limit);
139+ abort_unwind_decision = tvt (unwind >= *limit);
153140 }
154141
155142 INVARIANT (
@@ -187,25 +174,12 @@ bool symex_bmct::get_unwind_recursion(
187174 // / --unwind options to decide:
188175 if (abort_unwind_decision.is_unknown ())
189176 {
190- // We use the most specific limit we have,
191- // and 'infinity' when we have none.
192-
193- loop_limitst &this_thread_limits=
194- thread_loop_limits[thread_nr];
177+ auto limit=unwindset.get_limit (id, thread_nr);
195178
196- loop_limitst::const_iterator l_it=this_thread_limits.find (id);
197- if (l_it!=this_thread_limits.end ())
198- this_loop_limit=l_it->second ;
179+ if (limit.has_value ())
180+ abort_unwind_decision = tvt (false );
199181 else
200- {
201- l_it=loop_limits.find (id);
202- if (l_it!=loop_limits.end ())
203- this_loop_limit=l_it->second ;
204- else if (max_unwind_is_set)
205- this_loop_limit=max_unwind;
206- }
207-
208- abort_unwind_decision = tvt (unwind>this_loop_limit);
182+ abort_unwind_decision = tvt (unwind >= *limit);
209183 }
210184
211185 INVARIANT (
0 commit comments