fix bad argument processing in non-inlined arithmetic comparisons.

This commit is contained in:
Costa Vitor 2009-07-22 17:02:02 -05:00
parent c8946e1e4e
commit 0e2d3e3a91
1 changed files with 5 additions and 5 deletions

View File

@ -681,35 +681,35 @@ a_eq(Term t1, Term t2)
static Int static Int
a_dif(Term t1, Term t2) a_dif(Term t1, Term t2)
{ {
int out = a_cmp(t1,t2); int out = a_cmp(Deref(t1),Deref(t2));
return !ArithError && out != 0; return !ArithError && out != 0;
} }
static Int static Int
a_gt(Term t1, Term t2) a_gt(Term t1, Term t2)
{ /* A > B */ { /* A > B */
int out = a_cmp(t1,t2); int out = a_cmp(Deref(t1),Deref(t2));
return !ArithError && out > 0; return !ArithError && out > 0;
} }
static Int static Int
a_ge(Term t1, Term t2) a_ge(Term t1, Term t2)
{ /* A >= B */ { /* A >= B */
int out = a_cmp(t1,t2); int out = a_cmp(Deref(t1),Deref(t2));
return !ArithError && out >= 0; return !ArithError && out >= 0;
} }
static Int static Int
a_lt(Term t1, Term t2) a_lt(Term t1, Term t2)
{ /* A < B */ { /* A < B */
int out = a_cmp(t1,t2); int out = a_cmp(Deref(t1),Deref(t2));
return !ArithError && out < 0; return !ArithError && out < 0;
} }
static Int static Int
a_le(Term t1, Term t2) a_le(Term t1, Term t2)
{ /* A <= B */ { /* A <= B */
int out = a_cmp(t1,t2); int out = a_cmp(Deref(t1),Deref(t2));
return !ArithError && out <= 0; return !ArithError && out <= 0;
} }