check for enough head space
This commit is contained in:
parent
e85e76cd57
commit
9550393e66
18
C/compiler.c
18
C/compiler.c
@ -2109,14 +2109,14 @@ c_head(Term t, compiler_struct *cglobs)
|
|||||||
if (IsAtomTerm(t)) {
|
if (IsAtomTerm(t)) {
|
||||||
Yap_emit(name_op, (CELL) AtomOfTerm(t), Zero, &cglobs->cint);
|
Yap_emit(name_op, (CELL) AtomOfTerm(t), Zero, &cglobs->cint);
|
||||||
#ifdef BEAM
|
#ifdef BEAM
|
||||||
if (EAM) {
|
if (EAM) {
|
||||||
Yap_emit(run_op,Zero,(UInt) cglobs->cint.CurrentPred,&cglobs->cint);
|
Yap_emit(run_op,Zero,(UInt) cglobs->cint.CurrentPred,&cglobs->cint);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Yap_emit(ensure_space_op, Zero , Zero, &cglobs->cint);
|
||||||
|
cglobs->space_op = cglobs->cint.cpc;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Yap_emit(ensure_space_op, Zero , Zero, &cglobs->cint);
|
|
||||||
cglobs->space_op = cglobs->cint.cpc;
|
|
||||||
f = FunctorOfTerm(t);
|
f = FunctorOfTerm(t);
|
||||||
Yap_emit(name_op, (CELL) NameOfFunctor(f), ArityOfFunctor(f), &cglobs->cint);
|
Yap_emit(name_op, (CELL) NameOfFunctor(f), ArityOfFunctor(f), &cglobs->cint);
|
||||||
#ifdef BEAM
|
#ifdef BEAM
|
||||||
@ -2124,8 +2124,10 @@ c_head(Term t, compiler_struct *cglobs)
|
|||||||
Yap_emit(run_op,Zero,(UInt) cglobs->cint.CurrentPred,&cglobs->cint);
|
Yap_emit(run_op,Zero,(UInt) cglobs->cint.CurrentPred,&cglobs->cint);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (Yap_ExecutionMode == MIXED_MODE_USER)
|
if (Yap_ExecutionMode == MIXED_MODE_USER)
|
||||||
Yap_emit(native_op, 0, 0, &cglobs->cint);
|
Yap_emit(native_op, 0, 0, &cglobs->cint);
|
||||||
|
Yap_emit(ensure_space_op, Zero , Zero, &cglobs->cint);
|
||||||
|
cglobs->space_op = cglobs->cint.cpc;
|
||||||
c_args(t, 0, cglobs);
|
c_args(t, 0, cglobs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3537,6 +3539,10 @@ Yap_cclause(volatile Term inp_clause, Int NOfArgs, Term mod, volatile Term src)
|
|||||||
}
|
}
|
||||||
if (LOCAL_ErrorMessage)
|
if (LOCAL_ErrorMessage)
|
||||||
return (0);
|
return (0);
|
||||||
|
/* make sure we give enough space for the fact */
|
||||||
|
if (cglobs.space_op)
|
||||||
|
cglobs.space_op->rnd1 = cglobs.space_used;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (GLOBAL_Option['g' - 96])
|
if (GLOBAL_Option['g' - 96])
|
||||||
Yap_ShowCode(&cglobs.cint);
|
Yap_ShowCode(&cglobs.cint);
|
||||||
|
Reference in New Issue
Block a user