Commit 1a4c2d2c authored by Bob Fang's avatar Bob Fang

fix bug #171: a first attempt

fix bug #171: a first attempt
parent bc96d294
......@@ -396,7 +396,8 @@ Box* listContains(BoxedList* self, Box* elt) {
for (int i = 0; i < size; i++) {
Box* e = self->elts->elts[i];
Box* cmp = compareInternal(e, elt, AST_TYPE::Eq, NULL);
bool b = nonzero(cmp);
bool identity_eq = e == elt;
bool b = nonzero(cmp) || identity_eq;
if (b)
return True;
}
......@@ -518,7 +519,8 @@ Box* _listCmp(BoxedList* lhs, BoxedList* rhs, AST_TYPE::AST_TYPE op_type) {
int n = std::min(lsz, rsz);
for (int i = 0; i < n; i++) {
Box* is_eq = compareInternal(lhs->elts->elts[i], rhs->elts->elts[i], AST_TYPE::Eq, NULL);
bool bis_eq = nonzero(is_eq);
bool identity_eq = lhs->elts->elts[i] == rhs->elts->elts[i];
bool bis_eq = nonzero(is_eq) || identity_eq;
if (bis_eq)
continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment