be a bit more careful saving state.
This commit is contained in:
parent
20d31b8207
commit
55f28a75ab
@ -2316,7 +2316,7 @@ X_API int PL_next_solution(qid_t qi)
|
|||||||
if (setjmp(LOCAL_execution->env))
|
if (setjmp(LOCAL_execution->env))
|
||||||
return 0;
|
return 0;
|
||||||
if (qi->state == 0) {
|
if (qi->state == 0) {
|
||||||
result = YAP_RunGoal(qi->g);
|
result = YAP_RunGoal(qi->g);
|
||||||
} else {
|
} else {
|
||||||
LOCAL_AllowRestart = qi->open;
|
LOCAL_AllowRestart = qi->open;
|
||||||
result = YAP_RestartGoal();
|
result = YAP_RestartGoal();
|
||||||
@ -2330,7 +2330,7 @@ X_API int PL_next_solution(qid_t qi)
|
|||||||
|
|
||||||
X_API void PL_cut_query(qid_t qi)
|
X_API void PL_cut_query(qid_t qi)
|
||||||
{
|
{
|
||||||
if (qi->open != 1) return;
|
if (qi->open != 1 || qi->state == 0) return;
|
||||||
YAP_PruneGoal();
|
YAP_PruneGoal();
|
||||||
YAP_cut_up();
|
YAP_cut_up();
|
||||||
qi->open = 0;
|
qi->open = 0;
|
||||||
@ -2339,7 +2339,7 @@ X_API void PL_cut_query(qid_t qi)
|
|||||||
X_API void PL_close_query(qid_t qi)
|
X_API void PL_close_query(qid_t qi)
|
||||||
{
|
{
|
||||||
/* need to implement backtracking here */
|
/* need to implement backtracking here */
|
||||||
if (qi->open != 1)
|
if (qi->open != 1 || qi->state == 0)
|
||||||
return;
|
return;
|
||||||
YAP_PruneGoal();
|
YAP_PruneGoal();
|
||||||
YAP_RestartGoal();
|
YAP_RestartGoal();
|
||||||
|
Reference in New Issue
Block a user