Bug ID: 41485
           Summary: StaticAnalyzer/Checkers/IteratorChecker.cpp:1037]:
                    (error) Dead pointer usage
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs

clang/lib/StaticAnalyzer/Checkers/IteratorChecker.cpp:1037]: (error) Dead
pointer usage. Pointer 'value' is dead if it has been assigned '&val' at line

Source code is

  if (auto loc = RHS.getAs<Loc>()) {
    const auto val = State->getRawSVal(*loc);
    value = &val;

  auto &TgtVal = (Op == OO_PlusEqual || Op == OO_MinusEqual) ? LHS : RetVal;
  State =
      setIteratorPosition(State, TgtVal, advancePosition(C, Op, *Pos, *value));

Suggest move local variable val out to wider scope.

You are receiving this mail because:
You are on the CC list for the bug.
llvm-bugs mailing list

Reply via email to