From 2255c4cd4bdfffe66703ab1706820b00552f574c Mon Sep 17 00:00:00 2001 From: Heng Li Date: Wed, 12 Oct 2011 00:05:01 -0400 Subject: [PATCH] fixed a long existing bug This bug may cause segfault (though never to me) and lead to missing suboptimal hits. But the top hits should not be affected. --- bwtgap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bwtgap.c b/bwtgap.c index 3db1af2..9234f18 100644 --- a/bwtgap.c +++ b/bwtgap.c @@ -57,7 +57,7 @@ static inline void gap_push(gap_stack_t *stack, int a, int i, bwtint_t k, bwtint p = q->stack + q->n_entries; p->info = (u_int32_t)score<<21 | a<<20 | i; p->k = k; p->l = l; p->n_mm = n_mm; p->n_gapo = n_gapo; p->n_gape = n_gape; p->state = state; - if (is_diff) p->last_diff_pos = i; + p->last_diff_pos = is_diff? i : -1; ++(q->n_entries); ++(stack->n_entries); if (stack->best > score) stack->best = score;