diff options
author | Daniel Burrows <dburrows@debian.org> | 2010-04-19 06:41:59 -0700 |
---|---|---|
committer | Daniel Burrows <dburrows@debian.org> | 2010-04-19 06:41:59 -0700 |
commit | e1ac8839b621c5f558566fab50866cfc61f8051d (patch) | |
tree | 5fd2cd46930991e54b90724b31c81e879912596b /src/generic/problemresolver | |
parent | 7d75cd4b905cadcb6d166f88be23d0deb14f0dc6 (diff) | |
download | aptitude-e1ac8839b621c5f558566fab50866cfc61f8051d.tar.gz |
Hopefully fix a crashing bug in the resolver. (Closes: #578344)
When I built a new validity expression as a result of combining
promotions, I forgot that expressions can be NULL and that NULL is
implicitly treated as a universally true expression. It might be
more robust to fully incorporate that into the API of the expressions
module at some point.
Diffstat (limited to 'src/generic/problemresolver')
-rw-r--r-- | src/generic/problemresolver/promotion_set.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/generic/problemresolver/promotion_set.h b/src/generic/problemresolver/promotion_set.h index 2beb67d1..c37cdb1d 100644 --- a/src/generic/problemresolver/promotion_set.h +++ b/src/generic/problemresolver/promotion_set.h @@ -151,8 +151,16 @@ public: // Note that this will compute a somewhat inefficient validity // condition when applied across several expressions. - cwidget::util::ref_ptr<expression<bool> > new_valid = - and_e::create(p1_valid, p2_valid); + cwidget::util::ref_ptr<expression<bool> > new_valid; + if(p1_valid.valid()) + { + if(p2_valid.valid()) + new_valid = and_e::create(p1_valid, p2_valid); + else + new_valid = p1_valid; + } + else + new_valid = p2_valid; return generic_promotion(new_choices, new_cost, new_valid); } |