mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-22 16:32:13 -07:00
groupsolver: fix segfault accessing solver->names.
Reproduced via 'groupsolver -v 5i:l5_2b5h' (thanks to Arun Giridhar for the report). We had filled in subsolver.names, but then called latin_solver_alloc(&subsolver), which nulled out that pointer again. Solution: do those two things in the opposite order.
This commit is contained in:
7
latin.c
7
latin.c
@ -819,17 +819,18 @@ static int latin_solver_recurse
|
||||
} else {
|
||||
newctx = ctx;
|
||||
}
|
||||
if (latin_solver_alloc(&subsolver, outgrid, o)) {
|
||||
#ifdef STANDALONE_SOLVER
|
||||
subsolver.names = solver->names;
|
||||
subsolver.names = solver->names;
|
||||
#endif
|
||||
if (latin_solver_alloc(&subsolver, outgrid, o))
|
||||
ret = latin_solver_top(&subsolver, diff_recursive,
|
||||
diff_simple, diff_set_0, diff_set_1,
|
||||
diff_forcing, diff_recursive,
|
||||
usersolvers, valid, newctx,
|
||||
ctxnew, ctxfree);
|
||||
else
|
||||
} else {
|
||||
ret = diff_impossible;
|
||||
}
|
||||
latin_solver_free(&subsolver);
|
||||
if (ctxnew)
|
||||
ctxfree(newctx);
|
||||
|
Reference in New Issue
Block a user