fix error after error and error within error
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@344 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
c5267f786c
commit
20c6b50a0d
@ -160,7 +160,7 @@ AccessNamedArray(Atom a, Int indx)
|
|||||||
READ_LOCK(pp->ArRWLock);
|
READ_LOCK(pp->ArRWLock);
|
||||||
if (IsVarTerm(pp->ValueOfVE)) {
|
if (IsVarTerm(pp->ValueOfVE)) {
|
||||||
READ_UNLOCK(pp->ArRWLock);
|
READ_UNLOCK(pp->ArRWLock);
|
||||||
return(FALSE);
|
return(MkAtomTerm(AtomFoundVar));
|
||||||
}
|
}
|
||||||
out = RepAppl(pp->ValueOfVE)[indx+1];
|
out = RepAppl(pp->ValueOfVE)[indx+1];
|
||||||
READ_UNLOCK(pp->ArRWLock);
|
READ_UNLOCK(pp->ArRWLock);
|
||||||
@ -310,6 +310,9 @@ p_access_array(void)
|
|||||||
tf = (RepAppl(t))[indx + 1];
|
tf = (RepAppl(t))[indx + 1];
|
||||||
} else if (IsAtomTerm(t)) {
|
} else if (IsAtomTerm(t)) {
|
||||||
tf = AccessNamedArray(AtomOfTerm(t), indx);
|
tf = AccessNamedArray(AtomOfTerm(t), indx);
|
||||||
|
if (tf == MkAtomTerm(AtomFoundVar)) {
|
||||||
|
return(FALSE);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Error(TYPE_ERROR_ARRAY,t,"access_array");
|
Error(TYPE_ERROR_ARRAY,t,"access_array");
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
@ -350,7 +353,9 @@ p_array_arg(void)
|
|||||||
}
|
}
|
||||||
else if (IsAtomTerm(t)) {
|
else if (IsAtomTerm(t)) {
|
||||||
Term tf = AccessNamedArray(AtomOfTerm(t), indx);
|
Term tf = AccessNamedArray(AtomOfTerm(t), indx);
|
||||||
|
if (tf == MkAtomTerm(AtomFoundVar)) {
|
||||||
|
return(FALSE);
|
||||||
|
}
|
||||||
return (unify(tf, ARG1));
|
return (unify(tf, ARG1));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
23
C/errors.c
23
C/errors.c
@ -313,9 +313,26 @@ Error (yap_error_number type, Term where, char *format,...)
|
|||||||
char *tp = p;
|
char *tp = p;
|
||||||
int psize = 512;
|
int psize = 512;
|
||||||
|
|
||||||
/* disallow recursive error handling */
|
/* disallow recursive error handling */
|
||||||
if (PrologMode & InErrorMode)
|
if (PrologMode & InErrorMode) {
|
||||||
return(P);
|
/* error within error */
|
||||||
|
va_start (ap, format);
|
||||||
|
/* now build the error string */
|
||||||
|
if (format != NULL) {
|
||||||
|
#if HAVE_VSNPRINTF
|
||||||
|
(void) vsnprintf(p, 512, format, ap);
|
||||||
|
#else
|
||||||
|
(void) vsprintf(p, format, ap);
|
||||||
|
#endif
|
||||||
|
} else {
|
||||||
|
p[0] = '\0';
|
||||||
|
}
|
||||||
|
va_end (ap);
|
||||||
|
fprintf(stderr,"[ ERROR WITHIN ERROR: %s ]\n", p);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
if (P == FAILCODE)
|
||||||
|
return(P);
|
||||||
/* PURE_ABORT may not have set where correctly */
|
/* PURE_ABORT may not have set where correctly */
|
||||||
if (type == PURE_ABORT)
|
if (type == PURE_ABORT)
|
||||||
where = TermNil;
|
where = TermNil;
|
||||||
|
1
C/exec.c
1
C/exec.c
@ -1278,6 +1278,7 @@ JumpToEnv(Term t) {
|
|||||||
/* I could backtrack here, but it is easier to leave the unwinding
|
/* I could backtrack here, but it is easier to leave the unwinding
|
||||||
to the emulator */
|
to the emulator */
|
||||||
B->cp_a3 = t;
|
B->cp_a3 = t;
|
||||||
|
P = FAILCODE;
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
C/init.c
2
C/init.c
@ -1188,8 +1188,6 @@ InitStacks(int Heap,
|
|||||||
ReleaseAtom(AtomFoundVar);
|
ReleaseAtom(AtomFoundVar);
|
||||||
LookupAtomWithAddress("[]",&(SF_STORE->AtNil));
|
LookupAtomWithAddress("[]",&(SF_STORE->AtNil));
|
||||||
LookupAtomWithAddress(".",&(SF_STORE->AtDot));
|
LookupAtomWithAddress(".",&(SF_STORE->AtDot));
|
||||||
PutValue(LookupAtom("$catch_counter"),
|
|
||||||
MkIntTerm(0));
|
|
||||||
/* InitAbsmi must be done before InitCodes */
|
/* InitAbsmi must be done before InitCodes */
|
||||||
#ifdef MPW
|
#ifdef MPW
|
||||||
InitAbsmi(REGS, FunctorList);
|
InitAbsmi(REGS, FunctorList);
|
||||||
|
4
H/Regs.h
4
H/Regs.h
@ -10,7 +10,7 @@
|
|||||||
* File: Regs.h *
|
* File: Regs.h *
|
||||||
* mods: *
|
* mods: *
|
||||||
* comments: YAP abstract machine registers *
|
* comments: YAP abstract machine registers *
|
||||||
* version: $Id: Regs.h,v 1.11 2002-01-14 22:26:51 vsc Exp $ *
|
* version: $Id: Regs.h,v 1.12 2002-02-01 15:48:17 vsc Exp $ *
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
@ -336,7 +336,7 @@ EXTERN inline void restore_TR(void) {
|
|||||||
TR = REGS.TR_;
|
TR = REGS.TR_;
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(__GNUC__) && defined(mips)
|
#elif defined(__GNUC__) && defined(mips) && defined(VSC_UNDEFINED)
|
||||||
|
|
||||||
#define P REGS.P_ /* prolog machine program counter */
|
#define P REGS.P_ /* prolog machine program counter */
|
||||||
#define YENV REGS.YENV_ /* current environment (may differ from ENV) */
|
#define YENV REGS.YENV_ /* current environment (may differ from ENV) */
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
<h2>Yap-4.3.21:</h2>
|
<h2>Yap-4.3.21:</h2>
|
||||||
<ul>
|
<ul>
|
||||||
|
<li>FIXED: access to non-existing dynamic array should not core-dump.</li>
|
||||||
|
<li>FIXED: abolish(_) should give error in ISO mode.</li>
|
||||||
<li>NEW: yap_flag(argv,L) (Nicos Angelopoulos).</li>
|
<li>NEW: yap_flag(argv,L) (Nicos Angelopoulos).</li>
|
||||||
<li>FIXED: make user the name of the first three streams.</li>
|
<li>FIXED: make user the name of the first three streams.</li>
|
||||||
<li>NEW: reachable/3 in ugraphs (Nicos Angelopoulos).</li>
|
<li>NEW: reachable/3 in ugraphs (Nicos Angelopoulos).</li>
|
||||||
|
Reference in New Issue
Block a user