From b3acf5ffb28b26f7766cf4eac9b9553a3f118bff Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 25 May 2025 13:48:14 +0200 Subject: solver3: If no choice was made nothing to invert We sometimes enqueue no choice as the choice, specifically when an optional clause became unsat as we need to reenqueue it on undo. But of course, this breaks undoing stuff because now it tries to insert !root and then solver breaks. --- apt-pkg/solver3.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg/solver3.cc') diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index 3e2f53a26..749633d52 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -983,7 +983,7 @@ bool APT::Solver::Pop() std::cerr << "Backtracking to choice " << choice.toString(cache) << "\n"; // FIXME: There should be a reason! - if (not Enqueue(choice, false, {})) + if (not choice.empty() && not Enqueue(choice, false, {})) return false; if (unlikely(debug >= 2)) -- cgit v1.2.3-70-g09d2