Skip to content

Commit f022757

Browse files
committed
Fix compile problem with GCC 9
The complaint, that parts of optionalt may be used uninitialised, is unfounded, but there was no need for optional<reference_wrapper<...>> in the first place since that's just an elaborate alias for a pointer.
1 parent d424d92 commit f022757

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/goto-symex/complexity_limiter.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ bool complexity_limitert::are_loop_children_too_complicated(
9898
// complicated, we make sure we don't execute it the other 17 times. But as
9999
// soon as we're running the loop again via a different context it gets a
100100
// chance to redeem itself.
101-
optionalt<std::reference_wrapper<lexical_loopst::loopt>> loop_to_blacklist;
101+
lexical_loopst::loopt *loop_to_blacklist = nullptr;
102102
for(auto frame_iter = current_call_stack.rbegin();
103103
frame_iter != current_call_stack.rend();
104104
++frame_iter)
@@ -121,8 +121,7 @@ bool complexity_limitert::are_loop_children_too_complicated(
121121
sum_complexity += loop_info.children_too_complex;
122122
if(sum_complexity > max_loops_complexity)
123123
{
124-
loop_to_blacklist =
125-
std::reference_wrapper<lexical_loopst::loopt>(loop_info.loop);
124+
loop_to_blacklist = &loop_info.loop;
126125
}
127126
}
128127
}

0 commit comments

Comments
 (0)