From 428f7a6f262bab2d25a6137f3928c6282e12187e Mon Sep 17 00:00:00 2001 From: PKEuS Date: Mon, 1 Sep 2014 23:29:15 +0200 Subject: [PATCH] Attempt to fix crashs on clang test suite. --- lib/checkother.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 425db09d2..2a15efec5 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -594,7 +594,9 @@ void CheckOther::checkRedundantAssignment() writtenArgumentsEnd = 0; if (tok->str() == "?" && tok->astOperand2()) { - tok = Token::findsimplematch(tok->astOperand2(), ";"); + tok = Token::findmatch(tok->astOperand2(), ";|}"); + if (!tok) + break; varAssignments.clear(); memAssignments.clear(); } else if (tok->str() == "{" && tok->strAt(-1) != "{" && tok->strAt(-1) != "=" && tok->strAt(-4) != "case" && tok->strAt(-3) != "default") { // conditional or non-executable inner scope: Skip it and reset status