Mercurial > hg > octave-nkf
changeset 20721:9502e0142c19
Simplify error output if max_recursion_depth is exceeded (Bug #45843).
* error.cc (pr_where): Call unique on std::list frames.
* toplev.h (operator==): Declare equality operator for
octave_call_stack::stack_frame.
* toplev.cc (operator==): Implement equality operator for
octave_call_stack::stack_frame.
author | Stefan Miereis <stefan.miereis@gmx.de> |
---|---|
date | Sat, 05 Sep 2015 01:02:27 +0200 |
parents | 315b7d51d6c8 |
children | 8164c580922b |
files | libinterp/corefcn/error.cc libinterp/corefcn/toplev.cc libinterp/corefcn/toplev.h |
diffstat | 3 files changed, 21 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/error.cc +++ b/libinterp/corefcn/error.cc @@ -314,6 +314,10 @@ if (nframes > 0) pr_where_1 ("%s: called from\n", who); + // Print the error message only if it is different from the previous one; + // Makes the output more concise and readable. + frames.unique (); + for (std::list<octave_call_stack::stack_frame>::const_iterator p = frames.begin (); p != frames.end (); p++) {
--- a/libinterp/corefcn/toplev.cc +++ b/libinterp/corefcn/toplev.cc @@ -130,6 +130,21 @@ return retval; } +bool +octave_call_stack::stack_frame::operator== (const octave_call_stack::stack_frame &rhs) const +{ + if (this->line () != rhs.line ()) + return false; + else if (this->column () != rhs.column ()) + return false; + else if (this->fcn_file_name () != rhs.fcn_file_name ()) + return false; + else if (this->fcn_name () != rhs.fcn_name ()) + return false; + else + return true; +} + void octave_call_stack::create_instance (void) {