@@ -69,7 +69,7 @@ static int findArgumentPosRecursive(const Token* tok, const Token* tokToFind, b
6969{
7070 ++depth;
7171 if (!tok || depth >= 100 )
72- return -1 ;
72+ return -1 ; // TODO: add bailout message
7373 if (tok->str () == " ," ) {
7474 int res = findArgumentPosRecursive (tok->astOperand1 (), tokToFind, found, depth);
7575 if (res == -1 )
@@ -112,7 +112,7 @@ static void astFlattenCopy(T* tok, const char* op, OuputIterator out, int depth
112112{
113113 --depth;
114114 if (!tok || depth < 0 )
115- return ;
115+ return ; // TODO: add bailout message
116116 if (strcmp (tok->str ().c_str (), op) == 0 ) {
117117 astFlattenCopy (tok->astOperand1 (), op, out, depth);
118118 astFlattenCopy (tok->astOperand2 (), op, out, depth);
@@ -140,7 +140,7 @@ nonneg int astCount(const Token* tok, const char* op, int depth)
140140{
141141 --depth;
142142 if (!tok || depth < 0 )
143- return 0 ;
143+ return 0 ; // TODO: add bailout message
144144 if (strcmp (tok->str ().c_str (), op) == 0 )
145145 return astCount (tok->astOperand1 (), op, depth) + astCount (tok->astOperand2 (), op, depth);
146146 return 1 ;
@@ -1129,6 +1129,7 @@ bool exprDependsOnThis(const Token* expr, bool onVar, nonneg int depth)
11291129 return true ;
11301130 if (depth >= 1000 )
11311131 // Abort recursion to avoid stack overflow
1132+ // TODO: add bailout message
11321133 return true ;
11331134 ++depth;
11341135
@@ -1273,6 +1274,7 @@ static SmallVector<ReferenceToken> followAllReferencesInternal(const Token* tok,
12731274 if (!tok)
12741275 return {};
12751276 if (depth < 0 ) {
1277+ // TODO: add bailout message
12761278 SmallVector<ReferenceToken> refs_result;
12771279 refs_result.emplace_back (tok, std::move (errors));
12781280 return refs_result;
@@ -2931,7 +2933,7 @@ static bool isExpressionChangedAt(const F& getExprTok,
29312933 int depth)
29322934{
29332935 if (depth < 0 )
2934- return true ;
2936+ return true ; // TODO: add bailout message
29352937 if (!tok)
29362938 return false ;
29372939 if (!tok->isMutableExpr ())
@@ -2990,7 +2992,7 @@ Token* findVariableChanged(Token *start, const Token *end, int indirect, const n
29902992 if (!precedes (start, end))
29912993 return nullptr ;
29922994 if (depth < 0 )
2993- return start;
2995+ return start; // TODO: add bailout message
29942996 auto getExprTok = utils::memoize ([&] {
29952997 return findExpression (start, exprid);
29962998 });
@@ -3089,7 +3091,7 @@ static const Token* findExpressionChangedImpl(const Token* expr,
30893091 Find find)
30903092{
30913093 if (depth < 0 )
3092- return start;
3094+ return start; // TODO: add bailout message
30933095 if (!precedes (start, end))
30943096 return nullptr ;
30953097 const Token* result = nullptr ;
0 commit comments