fix error handling when copy_term was not called from a builtin.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@624 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2002-10-07 21:20:12 +00:00
parent 6dde85e627
commit dba17092b2
1 changed files with 3 additions and 0 deletions

View File

@ -307,6 +307,7 @@ CopyTerm(Term inp) {
Hi = H+1;
H += 2;
if ((res = copy_complex_term(Hi-2, Hi-1, Hi, Hi)) < 0) {
ARG1 = t;
if (res == -1) { /* handle overflow */
gc(2, ENV, P);
t = Deref(ARG1);
@ -339,6 +340,7 @@ CopyTerm(Term inp) {
{
int res;
if ((res = copy_complex_term(ap-1, ap+1, Hi, Hi)) < 0) {
ARG1 = t;
if (res == -1) { /* handle overflow */
gc(2, ENV, P);
t = Deref(ARG1);
@ -370,6 +372,7 @@ CopyTerm(Term inp) {
{
int res;
if ((res = copy_complex_term(ap, ap+ArityOfFunctor(f), HB0+1, HB0)) < 0) {
ARG1 = t;
if (res == -1) {
gc(2, ENV, P);
t = Deref(ARG1);