This commit is contained in:
Vitor Santos Costa 2016-08-16 09:32:27 -05:00
parent 2726fb279c
commit 93068241d3
3 changed files with 9 additions and 11 deletions

View File

@ -634,7 +634,8 @@ restart_aux:
i = IntOfTerm(EXTRA_CBACK_ARG(3, 1));
max = IntOfTerm(EXTRA_CBACK_ARG(3, 2));
EXTRA_CBACK_ARG(3, 1) = MkIntTerm(i + 1);
if (!Yap_SpliceAtom(t3, ats, i, max PASS_REGS)) {
if (!Yap_SpliceAtom(t3, ats, i, max PASS_REGS) && LOCAL_Error_TYPE ==
YAP_NO_ERROR) {
cut_fail();
} else {
if (i < max)
@ -650,7 +651,7 @@ restart_aux:
if (Yap_HandleError("atom_concat/3")) {
goto restart_aux;
} else {
return FALSE;
return false;
}
}
cut_fail();
@ -672,17 +673,14 @@ restart_aux:
ot = ARG2;
} else if (Yap_IsGroundTerm(t2) && Yap_IsGroundTerm(t3)) {
at = Yap_SubtractTailAtom(Deref(ARG3), t2 PASS_REGS);
ot = ARG1;
ot = ARG1;
} else if (Yap_IsGroundTerm(t3)) {
EXTRA_CBACK_ARG(3, 1) = MkIntTerm(0);
EXTRA_CBACK_ARG(3, 2) = MkIntTerm(Yap_AtomToLength(t3 PASS_REGS));
return cont_atom_concat3(PASS_REGS1);
} else {
LOCAL_Error_TYPE = INSTANTIATION_ERROR;
LOCAL_Error_Term = t1;
Yap_Error(INSTANTIATION_ERROR, IsVarTerm(t1) ? t1 : t2,
"got atom_concat(X,atom,Z) or atom_concat(,atom,Y,Z)");
return false;
LOCAL_Error_TYPE = INSTANTIATION_ERROR;
LOCAL_Error_Term = t1;
}
if (at) {
if (Yap_unify(ot, MkAtomTerm(at)))

View File

@ -1045,7 +1045,7 @@ static Int peek_byte(USES_REGS1) { /* at_end_of_stream */
if (sno < 0)
return (FALSE);
if (false && !(GLOBAL_Stream[sno].status & Binary_Stream_f)) {
if (!(GLOBAL_Stream[sno].status & Binary_Stream_f)) {
UNLOCK(GLOBAL_Stream[sno].streamlock);
Yap_Error(PERMISSION_ERROR_INPUT_BINARY_STREAM, ARG1, "peek_byte/2");
return (FALSE);
@ -1087,7 +1087,7 @@ static Int peek_byte_1(USES_REGS1) { /* at_end_of_stream */
#endif
}
UNLOCK(GLOBAL_Stream[sno].streamlock);
return (Yap_unify_constant(ARG2, MkIntTerm(ch)));
return (Yap_unify_constant(ARG1, MkIntTerm(ch)));
}
/** @pred peek_char(+_S_, - _C_) is iso

View File

@ -1594,7 +1594,7 @@ int Yap_CheckBinaryStream__(const char *file, const char *f, int line, Term arg,
int sno;
if ((sno = CheckStream__(file, f, line, arg, kind, msg)) < 0)
return -1;
if ((GLOBAL_Stream[sno].status & Binary_Stream_f)) {
if (!(GLOBAL_Stream[sno].status & Binary_Stream_f)) {
UNLOCK(GLOBAL_Stream[sno].streamlock);
if (kind == Input_Stream_f)
PlIOError__(file, f, line, PERMISSION_ERROR_INPUT_TEXT_STREAM, arg, msg);