From 95ca8a263007666fb210ed8ff6be6429c78b8bc2 Mon Sep 17 00:00:00 2001 From: Markus Triska Date: Mon, 18 May 2020 09:58:09 +0200 Subject: [PATCH] throw instantiation error if the list of options contains a variable (#523) Many thanks to @notoria for the test case! --- src/prolog/lib/crypto.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/prolog/lib/crypto.pl b/src/prolog/lib/crypto.pl index be6b6b31..7a246432 100644 --- a/src/prolog/lib/crypto.pl +++ b/src/prolog/lib/crypto.pl @@ -259,6 +259,10 @@ crypto_data_hkdf(Data0, L, Bytes, Options0) :- '$crypto_data_hkdf'(Data, SaltBytes, Info, Algorithm, L, Bytes). option(What, Options, Default) :- + ( member(V, Options), var(V) -> + instantiation_error(option/3) + ; true + ), ( member(What, Options) -> true ; What =.. [_,Default] ). -- 2.54.0