From: Michael Schroeder Date: Wed, 16 Apr 2008 14:26:58 +0000 (+0000) Subject: - fix segfault in solver (bnc#380406) X-Git-Tag: BASE-SuSE-Code-12_1-Branch~715 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=65ce90cdd479b2ddc9edadc2e0f2330bb42ac26b;p=platform%2Fupstream%2Flibsolv.git - fix segfault in solver (bnc#380406) --- diff --git a/src/solver.c b/src/solver.c index 033fc13..1952d28 100644 --- a/src/solver.c +++ b/src/solver.c @@ -788,11 +788,7 @@ enabledisablelearntrules(Solver *solv) whyp = solv->learnt_pool.elements + solv->learnt_why.elements[i - solv->learntrules]; while ((why = *whyp++) != 0) { -#if 0 - if (why < 0) - continue; /* rpm assertion */ -#endif - assert(why < i); + assert(why > 0 && why < i); if (!solv->rules[why].w1) break; } @@ -1645,17 +1641,11 @@ analyze(Solver *solv, int level, Rule *c, int *pr, int *dr, int *whyp) vv = v > 0 ? v : -v; if (!MAPTST(&seen, vv)) continue; + l = solv->decisionmap[vv]; + if (l != 1 && l != -1) + continue; why = solv->decisionq_why.elements[idx]; - if (!why) - { - queue_push(&solv->learnt_pool, -vv); - IF_POOLDEBUG (SAT_DEBUG_ANALYZE) - { - POOL_DEBUG(SAT_DEBUG_ANALYZE, "RPM ASSERT Rule:\n"); - printruleelement(solv, SAT_DEBUG_ANALYZE, 0, v); - } - continue; - } + assert(why); queue_push(&solv->learnt_pool, why); c = solv->rules + why; dp = c->d ? pool->whatprovidesdata + c->d : 0;