Skip to content

Commit

Permalink
fix potential panic on compiling :-/1.
Browse files Browse the repository at this point in the history
  • Loading branch information
ichiban committed Jul 23, 2022
1 parent 75737ad commit cf64d11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion engine/clause.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ type clause struct {
}

func compile(t Term) (clauses, error) {
if t, ok := t.(*Compound); ok && t.Functor == ":-" {
if t, ok := t.(*Compound); ok && t.Functor == ":-" && len(t.Args) == 2 {
var cs []clause
head, body := t.Args[0], t.Args[1]
iter := AltIterator{Alt: body}
Expand Down

0 comments on commit cf64d11

Please sign in to comment.