From 121d4ff2ba403433ffb6a8524d3f1ba5f7a7ac6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 22 Apr 2018 07:30:45 +0200 Subject: [PATCH] isLikelyStreamRead: when using & dont allow astParent --- lib/astutils.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/astutils.cpp b/lib/astutils.cpp index a850e3e23..65c6066e8 100644 --- a/lib/astutils.cpp +++ b/lib/astutils.cpp @@ -636,6 +636,8 @@ bool isLikelyStreamRead(bool cpp, const Token *op) parent = parent->astParent(); if (parent->astParent() && !Token::Match(parent->astParent(), "%oror%|&&|(|,|!")) return false; + if (op->str() == "&" && parent->astParent()) + return false; if (!parent->astOperand1() || !parent->astOperand2()) return false; return (!parent->astOperand1()->valueType() || !parent->astOperand1()->valueType()->isIntegral());