handle overflow error in YAP_MkPairTerm ( obs from Fabrizio Riguzzi).
This commit is contained in:
parent
02e82d7719
commit
11cefa668a
@ -857,11 +857,18 @@ YAP_MkPairTerm(Term t1, Term t2)
|
|||||||
Term t;
|
Term t;
|
||||||
BACKUP_H();
|
BACKUP_H();
|
||||||
|
|
||||||
if (H > ASP-1024)
|
if (H > ASP-1024) {
|
||||||
t = TermNil;
|
long sl1 = Yap_InitSlot(t1);
|
||||||
else
|
long sl2 = Yap_InitSlot(t2);
|
||||||
t = MkPairTerm(t1, t2);
|
if (!dogc()) {
|
||||||
|
RECOVER_H();
|
||||||
|
return TermNil;
|
||||||
|
}
|
||||||
|
t1 = Yap_GetFromSlot(sl1);
|
||||||
|
t2 = Yap_GetFromSlot(sl2);
|
||||||
|
Yap_RecoverSlots(2);
|
||||||
|
}
|
||||||
|
t = MkPairTerm(t1, t2);
|
||||||
RECOVER_H();
|
RECOVER_H();
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user