do not reset error status
This commit is contained in:
parent
350081a90d
commit
868ecfe551
21
C/dbase.c
21
C/dbase.c
@ -1408,7 +1408,7 @@ static DBRef CreateDBStruct(Term Tm, DBProp p, int InFlag, int *pstat,
|
|||||||
DBRef *TmpRefBase = (DBRef *)LOCAL_TrailTop;
|
DBRef *TmpRefBase = (DBRef *)LOCAL_TrailTop;
|
||||||
CELL *CodeAbs; /* how much code did we find */
|
CELL *CodeAbs; /* how much code did we find */
|
||||||
int vars_found = FALSE;
|
int vars_found = FALSE;
|
||||||
|
yap_error_number oerr = LOCAL_Error_TYPE;
|
||||||
LOCAL_Error_TYPE = YAP_NO_ERROR;
|
LOCAL_Error_TYPE = YAP_NO_ERROR;
|
||||||
|
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
@ -1418,6 +1418,7 @@ static DBRef CreateDBStruct(Term Tm, DBProp p, int InFlag, int *pstat,
|
|||||||
#endif
|
#endif
|
||||||
DBRef out = (DBRef)CreateDBTermForVar(extra_size, dbg);
|
DBRef out = (DBRef)CreateDBTermForVar(extra_size, dbg);
|
||||||
*pstat = TRUE;
|
*pstat = TRUE;
|
||||||
|
LOCAL_Error_TYPE = oerr;
|
||||||
return out;
|
return out;
|
||||||
#ifdef COROUTINING
|
#ifdef COROUTINING
|
||||||
}
|
}
|
||||||
@ -1425,6 +1426,7 @@ static DBRef CreateDBStruct(Term Tm, DBProp p, int InFlag, int *pstat,
|
|||||||
} else if (IsAtomOrIntTerm(Tm)) {
|
} else if (IsAtomOrIntTerm(Tm)) {
|
||||||
DBRef out = (DBRef)CreateDBTermForAtom(Tm, extra_size, dbg);
|
DBRef out = (DBRef)CreateDBTermForAtom(Tm, extra_size, dbg);
|
||||||
*pstat = FALSE;
|
*pstat = FALSE;
|
||||||
|
LOCAL_Error_TYPE = oerr;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1434,8 +1436,10 @@ static DBRef CreateDBStruct(Term Tm, DBProp p, int InFlag, int *pstat,
|
|||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
*pstat = TRUE;
|
*pstat = TRUE;
|
||||||
|
LOCAL_Error_TYPE = oerr;
|
||||||
return CreateDBRefForVar(Tm, p, InFlag, dbg);
|
return CreateDBRefForVar(Tm, p, InFlag, dbg);
|
||||||
} else if (IsAtomOrIntTerm(Tm)) {
|
} else if (IsAtomOrIntTerm(Tm)) {
|
||||||
|
LOCAL_Error_TYPE = oerr;
|
||||||
return CreateDBRefForAtom(Tm, p, InFlag, dbg);
|
return CreateDBRefForAtom(Tm, p, InFlag, dbg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1463,6 +1467,7 @@ static DBRef CreateDBStruct(Term Tm, DBProp p, int InFlag, int *pstat,
|
|||||||
LOCAL_Error_Size = (UInt)(extra_size + sizeof(ppt0));
|
LOCAL_Error_Size = (UInt)(extra_size + sizeof(ppt0));
|
||||||
LOCAL_Error_TYPE = RESOURCE_ERROR_AUXILIARY_STACK;
|
LOCAL_Error_TYPE = RESOURCE_ERROR_AUXILIARY_STACK;
|
||||||
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
||||||
|
LOCAL_Error_TYPE = oerr;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
ntp0 = ppt0->Contents;
|
ntp0 = ppt0->Contents;
|
||||||
@ -1470,6 +1475,8 @@ static DBRef CreateDBStruct(Term Tm, DBProp p, int InFlag, int *pstat,
|
|||||||
LOCAL_Error_Size = 0;
|
LOCAL_Error_Size = 0;
|
||||||
LOCAL_Error_TYPE = RESOURCE_ERROR_TRAIL;
|
LOCAL_Error_TYPE = RESOURCE_ERROR_TRAIL;
|
||||||
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
||||||
|
LOCAL_Error_TYPE = oerr;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
dbg->lr = dbg->LinkAr = (link_entry *)TR;
|
dbg->lr = dbg->LinkAr = (link_entry *)TR;
|
||||||
@ -1481,6 +1488,7 @@ static DBRef CreateDBStruct(Term Tm, DBProp p, int InFlag, int *pstat,
|
|||||||
&attachments, &vars_found, dbg);
|
&attachments, &vars_found, dbg);
|
||||||
if (ntp == NULL) {
|
if (ntp == NULL) {
|
||||||
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
||||||
|
LOCAL_Error_TYPE = oerr;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
@ -1495,6 +1503,7 @@ static DBRef CreateDBStruct(Term Tm, DBProp p, int InFlag, int *pstat,
|
|||||||
&vars_found, dbg);
|
&vars_found, dbg);
|
||||||
if (ntp == NULL) {
|
if (ntp == NULL) {
|
||||||
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
||||||
|
LOCAL_Error_TYPE = oerr;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1535,6 +1544,7 @@ static DBRef CreateDBStruct(Term Tm, DBProp p, int InFlag, int *pstat,
|
|||||||
&vars_found, dbg);
|
&vars_found, dbg);
|
||||||
if (ntp == NULL) {
|
if (ntp == NULL) {
|
||||||
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
||||||
|
LOCAL_Error_TYPE = oerr;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1542,6 +1552,7 @@ static DBRef CreateDBStruct(Term Tm, DBProp p, int InFlag, int *pstat,
|
|||||||
CodeAbs = (CELL *)((CELL)ntp - (CELL)ntp0);
|
CodeAbs = (CELL *)((CELL)ntp - (CELL)ntp0);
|
||||||
if (LOCAL_Error_TYPE) {
|
if (LOCAL_Error_TYPE) {
|
||||||
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
||||||
|
LOCAL_Error_TYPE = oerr;
|
||||||
return NULL; /* Error Situation */
|
return NULL; /* Error Situation */
|
||||||
}
|
}
|
||||||
NOfCells = ntp - ntp0; /* End Of Code Info */
|
NOfCells = ntp - ntp0; /* End Of Code Info */
|
||||||
@ -1560,11 +1571,13 @@ static DBRef CreateDBStruct(Term Tm, DBProp p, int InFlag, int *pstat,
|
|||||||
LOCAL_Error_Size = (UInt)DBLength(CodeAbs);
|
LOCAL_Error_Size = (UInt)DBLength(CodeAbs);
|
||||||
LOCAL_Error_TYPE = RESOURCE_ERROR_AUXILIARY_STACK;
|
LOCAL_Error_TYPE = RESOURCE_ERROR_AUXILIARY_STACK;
|
||||||
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
||||||
|
LOCAL_Error_TYPE = oerr;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if ((InFlag & MkIfNot) &&
|
if ((InFlag & MkIfNot) &&
|
||||||
(dbg->found_one = check_if_wvars(p->First, NOfCells, ntp0))) {
|
(dbg->found_one = check_if_wvars(p->First, NOfCells, ntp0))) {
|
||||||
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
||||||
|
LOCAL_Error_TYPE = oerr;
|
||||||
return dbg->found_one;
|
return dbg->found_one;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1572,6 +1585,7 @@ static DBRef CreateDBStruct(Term Tm, DBProp p, int InFlag, int *pstat,
|
|||||||
if ((InFlag & MkIfNot) &&
|
if ((InFlag & MkIfNot) &&
|
||||||
(dbg->found_one = check_if_nvars(p->First, NOfCells, ntp0, dbg))) {
|
(dbg->found_one = check_if_nvars(p->First, NOfCells, ntp0, dbg))) {
|
||||||
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
||||||
|
LOCAL_Error_TYPE = oerr;
|
||||||
return dbg->found_one;
|
return dbg->found_one;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1581,6 +1595,7 @@ static DBRef CreateDBStruct(Term Tm, DBProp p, int InFlag, int *pstat,
|
|||||||
LOCAL_Error_Size = (UInt)DBLength(CodeAbs);
|
LOCAL_Error_Size = (UInt)DBLength(CodeAbs);
|
||||||
LOCAL_Error_TYPE = RESOURCE_ERROR_AUXILIARY_STACK;
|
LOCAL_Error_TYPE = RESOURCE_ERROR_AUXILIARY_STACK;
|
||||||
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
||||||
|
LOCAL_Error_TYPE = oerr;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
flag |= DBWithRefs;
|
flag |= DBWithRefs;
|
||||||
@ -1588,6 +1603,7 @@ static DBRef CreateDBStruct(Term Tm, DBProp p, int InFlag, int *pstat,
|
|||||||
#if SIZEOF_LINK_ENTRY == 2
|
#if SIZEOF_LINK_ENTRY == 2
|
||||||
if (Unsigned(CodeAbs) >= 0x40000) {
|
if (Unsigned(CodeAbs) >= 0x40000) {
|
||||||
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
||||||
|
LOCAL_Error_TYPE = oerr;
|
||||||
return generate_dberror_msg(SYSTEM_ERROR_INTERNAL, 0,
|
return generate_dberror_msg(SYSTEM_ERROR_INTERNAL, 0,
|
||||||
"trying to store term larger than 256KB");
|
"trying to store term larger than 256KB");
|
||||||
}
|
}
|
||||||
@ -1598,6 +1614,7 @@ static DBRef CreateDBStruct(Term Tm, DBProp p, int InFlag, int *pstat,
|
|||||||
ppt = (DBTerm *)(ptr + extra_size);
|
ppt = (DBTerm *)(ptr + extra_size);
|
||||||
if (ptr == NULL) {
|
if (ptr == NULL) {
|
||||||
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
||||||
|
LOCAL_Error_TYPE = oerr;
|
||||||
return generate_dberror_msg(RESOURCE_ERROR_HEAP, sz,
|
return generate_dberror_msg(RESOURCE_ERROR_HEAP, sz,
|
||||||
"heap crashed against stacks");
|
"heap crashed against stacks");
|
||||||
}
|
}
|
||||||
@ -1609,6 +1626,7 @@ static DBRef CreateDBStruct(Term Tm, DBProp p, int InFlag, int *pstat,
|
|||||||
pp = AllocDBSpace(sz);
|
pp = AllocDBSpace(sz);
|
||||||
if (pp == NULL) {
|
if (pp == NULL) {
|
||||||
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
||||||
|
LOCAL_Error_TYPE = oerr;
|
||||||
return generate_dberror_msg(RESOURCE_ERROR_HEAP, sz,
|
return generate_dberror_msg(RESOURCE_ERROR_HEAP, sz,
|
||||||
"heap crashed against stacks");
|
"heap crashed against stacks");
|
||||||
}
|
}
|
||||||
@ -1682,6 +1700,7 @@ static DBRef CreateDBStruct(Term Tm, DBProp p, int InFlag, int *pstat,
|
|||||||
ppt->DBRefs = NULL;
|
ppt->DBRefs = NULL;
|
||||||
}
|
}
|
||||||
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
||||||
|
LOCAL_Error_TYPE = oerr;
|
||||||
return pp;
|
return pp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user