From 7b5c0b55d84b6f2b4239fc6618eee4b0a8113847 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Fri, 30 Mar 2007 16:29:35 +0000 Subject: [PATCH] avoid recursive dump() in case of math parsing problem. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17649 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/MathParser.C | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mathed/MathParser.C b/src/mathed/MathParser.C index 0e75ffaaa6..e8697a668a 100644 --- a/src/mathed/MathParser.C +++ b/src/mathed/MathParser.C @@ -592,12 +592,20 @@ void Parser::tokenize(docstring const & buffer) void Parser::dump() const { lyxerr << "\nTokens: "; + static bool anti_recursive = true; for (unsigned i = 0; i < tokens_.size(); ++i) { + anti_recursive = !anti_recursive; if (i == pos_) lyxerr << " <#> "; lyxerr << tokens_[i]; + if (anti_recursive) { + lyxerr << "\nRecursive Parser::dump() detected!" << endl; + BOOST_ASSERT(false); + exit(1); + } } lyxerr << " pos: " << pos_ << endl; + anti_recursive = true; } -- 2.39.5