aboutsummaryrefslogtreecommitdiffstats
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 61f99a1c70..0457f841ac 100644
--- a/eval.c
+++ b/eval.c
@@ -365,7 +365,8 @@ rb_clear_cache_for_remove(VALUE klass, ID id)
for (i=0; i<CACHE_SIZE; i++) {
for (j=0; j<2; j++) {
struct cache_entry *ent = cache[j]+i;
- if (ent->origin == klass && ent->mid == id) {
+ if (ent->mid == id &&
+ RCLASS(ent->origin)->m_tbl == RCLASS(klass)->m_tbl) {
ent->mid = 0;
}
}