martong marked an inline comment as done. martong added inline comments.
================ Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1944-1945 + return; + if (!BO->isMultiplicativeOp()) + return; + ---------------- steakhal wrote: > There are only 3 multiplicative operators: > ``` > BINARY_OPERATION(Mul, "*") > BINARY_OPERATION(Div, "/") > BINARY_OPERATION(Rem, "%") > ``` > So, the opcode can never be `BO_MulAssign` later. > The comment for the else block is also inaccurate for the same reason. Yep, good catch! The reason why the assignment test case passed is that we already handle assignment operations in the `FindLastStoreBRVisitor`. // If this is an assignment expression, we can track the value // being assigned. if (Optional<PostStmt> P = Succ->getLocationAs<PostStmt>()) if (const BinaryOperator *BO = P->getStmtAs<BinaryOperator>()) if (BO->isAssignmentOp()) InitE = BO->getRHS(); So, I could just remove the handling of the assignment from the new function. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99344/new/ https://reviews.llvm.org/D99344 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits