From 2600dee36cc0aefd85d9cf97ede583b777631c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 8 Mar 2020 11:49:14 +0100 Subject: [PATCH] ForwardAnalyzer: Fix crash in cast '(T* &&)', the && does not have operands --- lib/forwardanalyzer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/forwardanalyzer.cpp b/lib/forwardanalyzer.cpp index b7ec51f9c..d7c882870 100644 --- a/lib/forwardanalyzer.cpp +++ b/lib/forwardanalyzer.cpp @@ -232,6 +232,11 @@ struct ForwardTraversal { for (Token* tok = start; tok && tok != end; tok = tok->next()) { Token* next = nullptr; + if (tok->str() == "(" && tok->isCast()) { + tok = tok->link(); + continue; + } + // Evaluate RHS of assignment before LHS if (Token* assignTok = assignExpr(tok)) { if (updateRecursive(assignTok->astOperand2()) == Progress::Break)