don't blow up with bad modules

This commit is contained in:
Vitor Santos Costa 2016-06-02 10:51:36 +01:00
parent d0658b7b53
commit 66709db4bb
1 changed files with 2 additions and 2 deletions

View File

@ -1084,15 +1084,15 @@ static Int _user_expand_goal(USES_REGS1) {
}
static Int do_term_expansion(USES_REGS1) {
yhandle_t sl = Yap_StartSlots();
yhandle_t sl = Yap_StartSlots();
Int creeping = Yap_get_signal(YAP_CREEP_SIGNAL);
PredEntry *pe;
Term cmod = CurrentModule, omod = cmod;
Term mg_args[2];
Term g = Yap_YapStripModule(ARG1, &cmod);
yhandle_t h1 = Yap_InitSlot(g), h2 = Yap_InitSlot(ARG2);
/* user:term_expansion(A,B) */
ARG1 = g;
if ((pe = RepPredProp(Yap_GetPredPropByFunc(FunctorTermExpansion, USER_MODULE))) &&
pe->OpcodeOfPred != FAIL_OPCODE && pe->OpcodeOfPred != UNDEF_OPCODE &&