Fixed #8193 (crash: A = -(-0.2) / (1.0 + B * B) ( daca, lammps))

This commit is contained in:
Daniel Marjamäki 2017-09-01 22:15:09 +02:00
parent beba46987d
commit 3bbcede43b
1 changed files with 1 additions and 1 deletions

View File

@ -221,7 +221,7 @@ bool isSameExpression(bool cpp, bool macro, const Token *tok1, const Token *tok2
return true; return true;
// in c++, a+b might be different to b+a, depending on the type of a and b // in c++, a+b might be different to b+a, depending on the type of a and b
if (cpp && tok1->str() == "+") { if (cpp && tok1->str() == "+" && tok1->astOperand2()) {
const ValueType* vt1 = tok1->astOperand1()->valueType(); const ValueType* vt1 = tok1->astOperand1()->valueType();
const ValueType* vt2 = tok1->astOperand2()->valueType(); const ValueType* vt2 = tok1->astOperand2()->valueType();
if (!(vt1 && (vt1->type >= ValueType::VOID || vt1->pointer) && vt2 && (vt2->type >= ValueType::VOID || vt2->pointer))) if (!(vt1 && (vt1->type >= ValueType::VOID || vt1->pointer) && vt2 && (vt2->type >= ValueType::VOID || vt2->pointer)))