From 08bded98e1e3dc9580e9e19332ca228b320b659a Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 19 Nov 2015 07:34:33 -0800 Subject: 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. --- lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v1.2.3