summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-11-19 07:34:33 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-11-20 16:17:19 -0800
commit08bded98e1e3dc9580e9e19332ca228b320b659a (patch)
tree8bc7790fef5122402eadbe2d9352182cb1dfd0cf
parenteb483eb39fa4570d1178a3f71fb65be908fd0d01 (diff)
downloadtxr-08bded98e1e3dc9580e9e19332ca228b320b659a.tar.gz
txr-08bded98e1e3dc9580e9e19332ca228b320b659a.tar.bz2
txr-08bded98e1e3dc9580e9e19332ca228b320b659a.zip
Fix type hole in equal function w.r.t. COBJ.
* lib.c (equal): We cannot pass both arguments to the left object's equal function just because both arguments are COBJ. We must make sure they are using the same operations. The equal functions blindly assume that both arguments are objects of the same type, and cast the pointers.
-rw-r--r--lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index 3752ace2..8bee41e5 100644
--- a/lib.c
+++ b/lib.c
@@ -2169,7 +2169,7 @@ val equal(val left, val right)
return t;
return nil;
case COBJ:
- if (type(right) == COBJ)
+ if (type(right) == COBJ && left->co.ops == right->co.ops)
return left->co.ops->equal(left, right);
return nil;
}