================ @@ -1822,20 +1817,28 @@ struct CounterCoverageMappingBuilder } void VisitBinLAnd(const BinaryOperator *E) { - // Keep track of Binary Operator and assign MCDC condition IDs + bool IsRootNode = MCDCBuilder.isIdle(); + + // Keep track of Binary Operator and assign MCDC condition IDs. MCDCBuilder.pushAndAssignIDs(E); extendRegion(E->getLHS()); propagateCounts(getRegion().getCounter(), E->getLHS()); handleFileExit(getEnd(E->getLHS())); + // Track LHS True/False Decision. + auto DecisionLHS = MCDCBuilder.pop(); + // Counter tracks the right hand side of a logical and operator. extendRegion(E->getRHS()); propagateCounts(getRegionCounter(E), E->getRHS()); - // Process Binary Operator and create MCDC Decision Region if top-level + // Track RHS True/False Decision. + const auto &DecisionRHS = MCDCBuilder.back(); ---------------- chapuni wrote:
This might crash if it would be moved before `propagateCounts(getRHS)`, since the stack might be reallocated in children. Could it be rewritten with passing by value (instead of by ref) for safety in the future? https://github.com/llvm/llvm-project/pull/78202 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits