diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-08-16 22:24:13 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-08-16 22:24:13 +0900 |
| commit | 38c4a3170b793ae69a82612f420fed8a1d0d67c3 (patch) | |
| tree | d613d02e0f34fc8df7d9ca5b6617799330a6ed60 /src | |
| parent | 23e88dba6e9cfaded527f477341e7a7fe50e6795 (diff) | |
| download | mruby-38c4a3170b793ae69a82612f420fed8a1d0d67c3.tar.gz mruby-38c4a3170b793ae69a82612f420fed8a1d0d67c3.zip | |
outer might be NULL; close #428
Diffstat (limited to 'src')
| -rw-r--r-- | src/variable.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/variable.c b/src/variable.c index 9b233cde8..6d0ab7557 100644 --- a/src/variable.c +++ b/src/variable.c @@ -905,13 +905,16 @@ mrb_class_sym(mrb_state *mrb, struct RClass *c, struct RClass *outer) name = mrb_obj_iv_get(mrb, (struct RObject*)c, mrb_intern(mrb, "__classid__")); if (mrb_nil_p(name)) { - struct csym_arg arg; - arg.c = c; - arg.sym = 0; + if (!outer) return 0; + else { + struct csym_arg arg; - iv_foreach(mrb, outer->iv, csym_i, &arg); - return arg.sym; + arg.c = c; + arg.sym = 0; + iv_foreach(mrb, outer->iv, csym_i, &arg); + return arg.sym; + } } return SYM2ID(name); } |
