From cf64d11435b2a8c598f5027d76563a0ce0b6cf06 Mon Sep 17 00:00:00 2001 From: Yutaka Ichibangase Date: Sat, 23 Jul 2022 09:03:30 +0900 Subject: [PATCH] fix potential panic on compiling :-/1. --- engine/clause.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/clause.go b/engine/clause.go index 31e9fabf..ace84cec 100644 --- a/engine/clause.go +++ b/engine/clause.go @@ -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}