summaryrefslogtreecommitdiffhomepage
path: root/src/class.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-01-24 17:54:05 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-01-24 17:54:05 +0900
commitb3ce364537cf1f745112d6e5acd71f009dcd872f (patch)
tree3d6a027ff71b50567fa0da6d61df9dea24768d4e /src/class.c
parent72bff2932ba983b4e8aaedda50fa5663dcc5c3ed (diff)
downloadmruby-b3ce364537cf1f745112d6e5acd71f009dcd872f.tar.gz
mruby-b3ce364537cf1f745112d6e5acd71f009dcd872f.zip
Outer class may be same as the class; fix #3382
Diffstat (limited to 'src/class.c')
-rw-r--r--src/class.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/class.c b/src/class.c
index 45827f5ba..81b312fd0 100644
--- a/src/class.c
+++ b/src/class.c
@@ -1586,7 +1586,7 @@ mrb_class_path(mrb_state *mrb, struct RClass *c)
if (sym == 0) {
return mrb_nil_value();
}
- else if (outer && outer != mrb->object_class) {
+ else if (outer && outer != c && outer != mrb->object_class) {
mrb_value base = mrb_class_path(mrb, outer);
path = mrb_str_buf_new(mrb, 0);
if (mrb_nil_p(base)) {