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:
parent
6dde85e627
commit
dba17092b2
@ -307,6 +307,7 @@ CopyTerm(Term inp) {
|
|||||||
Hi = H+1;
|
Hi = H+1;
|
||||||
H += 2;
|
H += 2;
|
||||||
if ((res = copy_complex_term(Hi-2, Hi-1, Hi, Hi)) < 0) {
|
if ((res = copy_complex_term(Hi-2, Hi-1, Hi, Hi)) < 0) {
|
||||||
|
ARG1 = t;
|
||||||
if (res == -1) { /* handle overflow */
|
if (res == -1) { /* handle overflow */
|
||||||
gc(2, ENV, P);
|
gc(2, ENV, P);
|
||||||
t = Deref(ARG1);
|
t = Deref(ARG1);
|
||||||
@ -339,6 +340,7 @@ CopyTerm(Term inp) {
|
|||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
if ((res = copy_complex_term(ap-1, ap+1, Hi, Hi)) < 0) {
|
if ((res = copy_complex_term(ap-1, ap+1, Hi, Hi)) < 0) {
|
||||||
|
ARG1 = t;
|
||||||
if (res == -1) { /* handle overflow */
|
if (res == -1) { /* handle overflow */
|
||||||
gc(2, ENV, P);
|
gc(2, ENV, P);
|
||||||
t = Deref(ARG1);
|
t = Deref(ARG1);
|
||||||
@ -370,6 +372,7 @@ CopyTerm(Term inp) {
|
|||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
if ((res = copy_complex_term(ap, ap+ArityOfFunctor(f), HB0+1, HB0)) < 0) {
|
if ((res = copy_complex_term(ap, ap+ArityOfFunctor(f), HB0+1, HB0)) < 0) {
|
||||||
|
ARG1 = t;
|
||||||
if (res == -1) {
|
if (res == -1) {
|
||||||
gc(2, ENV, P);
|
gc(2, ENV, P);
|
||||||
t = Deref(ARG1);
|
t = Deref(ARG1);
|
||||||
|
Reference in New Issue
Block a user