From 2b3404357a1f9991921189e331aeefb826f0523a Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 17 Mar 2022 12:08:44 -0400 Subject: analyzer: fix program_point::get_next for PK_BEFORE_STMT gcc/analyzer/ChangeLog: * program-point.cc (program_point::get_next): Fix missing increment of index. Signed-off-by: David Malcolm --- gcc/analyzer/program-point.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/analyzer/program-point.cc b/gcc/analyzer/program-point.cc index 5318dce..9e264b1 100644 --- a/gcc/analyzer/program-point.cc +++ b/gcc/analyzer/program-point.cc @@ -645,7 +645,7 @@ program_point::get_next () const return after_supernode (get_supernode (), get_call_string ()); case PK_BEFORE_STMT: { - unsigned next_idx = get_stmt_idx (); + unsigned next_idx = get_stmt_idx () + 1; if (next_idx < get_supernode ()->m_stmts.length ()) return before_stmt (get_supernode (), next_idx, get_call_string ()); else -- cgit v1.1