Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3

This commit is contained in:
Vitor Santos Costa
2014-03-15 22:48:12 +00:00
32 changed files with 202 additions and 159 deletions

View File

@@ -851,7 +851,7 @@ interrupt_call( USES_REGS1 )
return v;
PP = P->u.Osbpp.p0;
if (Yap_only_has_signal(YAP_CREEP_SIGNAL) &&
PP->ExtraPredFlags & (NoDebugPredFlag|HiddenPredFlag) )
(PP->ExtraPredFlags & (NoDebugPredFlag|HiddenPredFlag)) )
return 2;
S = (CELL *) P->u.Osbpp.p;
SET_ASP(YENV, P->u.Osbpp.s);
@@ -4442,7 +4442,7 @@ Yap_absmi(int inp)
FAIL();
}
BEGP(pt1);
pt1 = RepAppl(PREG->u.xu.u);
pt1 = RepAppl(PREG->u.xu.ut);
PREG = NEXTOP(PREG, xu);
if (
pt1[1] != pt0[1] ||
@@ -4460,7 +4460,7 @@ Yap_absmi(int inp)
/* set d1 to be the new structure we are going to create */
START_PREFETCH(xc);
BEGD(d1);
d1 = PREG->u.xu.u;
d1 = PREG->u.xu.ut;
PREG = NEXTOP(PREG, xu);
Bind(pt0, d1);
GONext();
@@ -6154,7 +6154,7 @@ Yap_absmi(int inp)
}
ENDD(d0);
BEGP(pt1);
pt1 = RepAppl(PREG->u.ou.u);
pt1 = RepAppl(PREG->u.ou.ut);
PREG = NEXTOP(PREG, ou);
if (
pt1[1] != pt0[1]
@@ -6166,7 +6166,7 @@ Yap_absmi(int inp)
derefa_body(d0, pt0, ustring_unk, ustring_nonvar);
BEGD(d1);
d1 = PREG->u.ou.u;
d1 = PREG->u.ou.ut;
PREG = NEXTOP(PREG, ou);
Bind_Global(pt0, d1);
GONext();
@@ -6194,7 +6194,7 @@ Yap_absmi(int inp)
}
ENDD(d0);
BEGP(pt1);
pt1 = RepAppl(PREG->u.ou.u);
pt1 = RepAppl(PREG->u.ou.ut);
PREG = NEXTOP(PREG, ou);
if (
pt1[1] != pt0[1]
@@ -6206,7 +6206,7 @@ Yap_absmi(int inp)
derefa_body(d0, S_SREG, ulstring_unk, ulstring_nonvar);
BEGD(d1);
d1 = PREG->u.ou.u;
d1 = PREG->u.ou.ut;
PREG = NEXTOP(PREG, ou);
Bind_Global(S_SREG, d1);
GONext();
@@ -9196,9 +9196,11 @@ Yap_absmi(int inp)
GONext();
}
}
break;
case (CELL)FunctorLongInt:
PREG = NEXTOP(PREG, xl);
GONext();
break;
default:
PREG = PREG->u.xl.F;
GONext();

View File

@@ -1149,7 +1149,7 @@ a_ustring(CELL rnd1, op_numbers opcode, op_numbers opcode_w, int *clause_has_blo
if (pass_no) {
code_p->opc = emit_op(opcode);
code_p->u.ou.opcw = emit_op(opcode_w);
code_p->u.ou.u =
code_p->u.ou.ut =
AbsAppl((CELL *)(Unsigned(cip->code_addr) + cip->label_offset[rnd1]));
}
*clause_has_blobsp = TRUE;
@@ -1403,7 +1403,7 @@ a_rstring(op_numbers opcode, int *clause_has_blobsp, yamop *code_p, int pass_no,
if (pass_no) {
code_p->opc = emit_op(opcode);
code_p->u.xu.x = emit_x(cip->cpc->rnd2);
code_p->u.xu.u = AbsAppl((CELL *)(Unsigned(cip->code_addr) + cip->label_offset[cip->cpc->rnd1]));
code_p->u.xu.ut = AbsAppl((CELL *)(Unsigned(cip->code_addr) + cip->label_offset[cip->cpc->rnd1]));
}
*clause_has_blobsp = TRUE;
GONEXT(xu);

View File

@@ -104,7 +104,13 @@ Eval(Term t USES_REGS)
return Yap_eval_atom(p->FOfEE);
} else if (IsApplTerm(t)) {
Functor fun = FunctorOfTerm(t);
if ((Atom)fun == AtomFoundVar) {
if (fun == FunctorString) {
const char *s = StringOfTerm(t);
if (s[1] == '\0')
return MkIntegerTerm(s[0]);
return Yap_ArithError(TYPE_ERROR_EVALUABLE, t,
"string in arithmetic expression");
} else if ((Atom)fun == AtomFoundVar) {
return Yap_ArithError(TYPE_ERROR_EVALUABLE, TermNil,
"cyclic term in arithmetic expression");
} else {

View File

@@ -1205,7 +1205,7 @@ add_arg_info(ClauseDef *clause, PredEntry *ap, UInt argno)
case _unify_l_string:
if (argno == 1) {
clause->Tag = AbsAppl((CELL *)FunctorString);
clause->ucd.t_ptr = cl->u.ou.u;
clause->ucd.t_ptr = cl->u.ou.ut;
return;
}
cl = NEXTOP(cl,ou);