check that Module is an atom before calling Module:goal_expansion/2

This commit is contained in:
Mark Thom
2021-02-28 18:28:12 -07:00
parent 9a225e6244
commit d6e04beb95

View File

@@ -60,7 +60,8 @@ term_expansion_list([Term|Terms], ExpandedTermsHead, ExpandedTermsTail) :-
goal_expansion(Goal, Module, ExpandedGoal) :-
( catch('$call'(Module:goal_expansion(Goal, ExpandedGoal0)),
( atom(Module),
catch('$call'(Module:goal_expansion(Goal, ExpandedGoal0)),
E,
'$call'(loader:'$print_message_and_fail'(E))) ->
( var(ExpandedGoal0) ->