summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index ba15931e69..2541e2e2e7 100644
--- a/eval.c
+++ b/eval.c
@@ -370,7 +370,8 @@ rb_clear_cache_for_undef(klass, id)
ent = cache; end = ent + CACHE_SIZE;
while (ent < end) {
if (ent->mid == id &&
- RCLASS(ent->origin)->m_tbl == RCLASS(klass)->m_tbl) {
+ (ent->klass == klass ||
+ RCLASS(ent->origin)->m_tbl == RCLASS(klass)->m_tbl)) {
ent->mid = 0;
}
ent++;