From 42432982ea14f74278a7fa168a18a746c16c5872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 2 Nov 2019 08:00:24 +0100 Subject: [PATCH] oss-fuzz: fixed inner assignment --- oss-fuzz/type2.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/oss-fuzz/type2.cpp b/oss-fuzz/type2.cpp index d5cc04d15..25f9e1cc8 100644 --- a/oss-fuzz/type2.cpp +++ b/oss-fuzz/type2.cpp @@ -69,7 +69,11 @@ static std::string generateExpression2_Expr(const uint8_t *data, size_t dataSize generateExpression2_Expr(data, dataSize, numberOfGlobalConstants, depth); const std::string rhs = generateExpression2_Expr(data, dataSize, numberOfGlobalConstants, depth); - return lhs + op + rhs; + std::string ret = lhs + op + rhs; + if (depth > 1 && op == '=') + ret = "(" + ret + ")"; + + return ret; } case 2: { const char *u = unop[getValue(data,dataSize,sizeof(unop)/sizeof(*unop))];