Skip to content

Commit

Permalink
valueflow.cpp: fixed -Wmaybe-uninitialized GCC warning in optimized…
Browse files Browse the repository at this point in the history
… build (#6430)

```
lib/valueflow.cpp: In function ‘const Token* ValueFlow::solveExprValue(const Token*, const std::function<std::vector<long long int>(const Token*)>&, Value&)’:
lib/valueflow.cpp:8405:28: warning: ‘intval’ may be used uninitialized [-Wmaybe-uninitialized]
 8405 |             value.intvalue /= intval;
      |             ~~~~~~~~~~~~~~~^~~~~~~~~
lib/valueflow.cpp:8383:21: note: ‘intval’ was declared here
 8383 |     MathLib::bigint intval;
      |                     ^~~~~~
```
  • Loading branch information
firewave committed May 23, 2024
1 parent 191f339 commit 3983c0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/valueflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8425,7 +8425,7 @@ const Token* ValueFlow::solveExprValue(const Token* expr,
return expr;
if (value.isSymbolicValue() && !Token::Match(expr, "+|-"))
return expr;
MathLib::bigint intval;
MathLib::bigint intval = 0;
const Token* binaryTok = parseBinaryIntOp(expr, eval, intval);
const bool rhs = astIsRHS(binaryTok);
// If its on the rhs, then -1 multiplication is needed, which is not possible with simple delta analysis used currently for symbolic values
Expand Down

0 comments on commit 3983c0c

Please sign in to comment.