From ebc0b6cd449e9db9f9dbebd21b6578bfb166f6a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 17 Aug 2014 14:28:31 +0200 Subject: [PATCH] astIsFloat: Fix crash when there is no second operand for '.' --- lib/checkother.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index fc6c41e27..ef1a14560 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -34,7 +34,7 @@ namespace { static bool astIsFloat(const Token *tok, bool unknown) { - if (tok->str() == ".") + if (tok->astOperand2() && tok->str() == ".") return astIsFloat(tok->astOperand2(), unknown); if (tok->astOperand1() && tok->str() != "?" && astIsFloat(tok->astOperand1(),unknown))