From a1e3aa45ba953a3a765f824477e4efc86f139e84 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Fri, 26 Feb 2010 10:22:41 +0000 Subject: [PATCH] protect against assert(1). --- pl/preds.yap | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pl/preds.yap b/pl/preds.yap index 32336c57d..d57108292 100644 --- a/pl/preds.yap +++ b/pl/preds.yap @@ -40,6 +40,8 @@ assert(C) :- '$do_error'(instantiation_error,assert(Mod:V)). '$assert'(V,Mod,_,_,_) :- var(Mod), !, '$do_error'(instantiation_error,assert(Mod:V)). +'$assert'(I,Mod,_,_,_) :- number(I), !, + '$do_error'(type_error(callable,I),assert(Mod:I)). '$assert'(M:C,_,Where,R,P) :- !, '$assert'(C,M,Where,R,P). '$assert'((H:-G),M1,Where,R,P) :- !,