Skip to content

Commit

Permalink
Fixed exec_all
Browse files Browse the repository at this point in the history
  • Loading branch information
sasagawa888 committed Nov 12, 2024
1 parent 659af31 commit 6439722
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion extension.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ int exec_all(int goals, int bindings)
if (nullp(goals))
return (YES);
/* ,(;(D1;D2),Xs)*/
else if (car(cadr(goals)) == OR){
else if (listp(goals) && car(cadr(goals)) == OR){
if(exec_all(cadr(cadr(goals)),bindings)==YES) return(exec_all(caddr(goals),bindings));
else if (exec_all(caddr(cadr(goals)),bindings) == YES) return(exec_all(caddr(goals),bindings));
else return(NO);
Expand Down
6 changes: 3 additions & 3 deletions library/compiler.pl
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@
write(';'),nl,
write('if(Jexec_all(Jaddtail_body(rest,body),Jget_sp()) == YES)'),nl,
write('return(YES);'),nl,
write('Junbind(dp['),write(N),write(']);body;}'),nl.
write('Junbind(dp['),write(N),write(']);}'),nl.


jump_gen_body((X;(Y1;Y2)),N) :-
Expand All @@ -493,7 +493,7 @@
write(';'),nl,
write('if(Jexec_all(Jaddtail_body(rest,body),Jget_sp()) == YES)'),nl,
write('return(YES);'),nl,
write('Junbind(dp['),write(N),write(']);body;}'),nl.
write('Junbind(dp['),write(N),write(']);}'),nl.

jump_gen_body((X;Y),N) :-
write('{dp['),write(N),write(']=Jget_sp();'),nl,
Expand All @@ -508,7 +508,7 @@
write(';'),nl,
write('if(Jexec_all(Jaddtail_body(rest,body),Jget_sp()) == YES)'),nl,
write('return(YES);'),nl,
write('Junbind(dp['),write(N),write(']);body;}'),nl.
write('Junbind(dp['),write(N),write(']);}'),nl.


% has cut
Expand Down

0 comments on commit 6439722

Please sign in to comment.