Skip to content

Commit f701467

Browse files
authored
Merge pull request #3528 from smowton/smowton/fix/symex-backtrace
Fix symex-backtrace when the stack is empty
2 parents 3db8d84 + 1538ca4 commit f701467

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/goto-symex/goto_symex_state.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,12 @@ void goto_symex_statet::get_l1_name(exprt &expr) const
765765
/// \param out: stream to write to
766766
void goto_symex_statet::print_backtrace(std::ostream &out) const
767767
{
768+
if(threads[source.thread_nr].call_stack.empty())
769+
{
770+
out << "No stack!\n";
771+
return;
772+
}
773+
768774
out << source.pc->function << " " << source.pc->location_number << "\n";
769775

770776
for(auto stackit = threads[source.thread_nr].call_stack.rbegin(),

0 commit comments

Comments
 (0)