summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-11-22 09:32:50 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-11-22 09:32:50 +0000
commitf047de71e6f3c9dabc58a5914550bc5f0f634601 (patch)
tree571a395d9cf1cf70a0139e0973c7872ef048bcd6 /eval.c
parente2d384d628c8e4bd59300844e9111645d1070d5a (diff)
* eval.c (rb_add_method): node may be NULL.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 0dd0e20..60e0d73 100644
--- a/eval.c
+++ b/eval.c
@@ -247,7 +247,7 @@ rb_add_method(klass, mid, node, noex)
if (ruby_safe_level >= 4 && (klass == rb_cObject || !OBJ_TAINTED(klass))) {
rb_raise(rb_eSecurityError, "Insecure: can't define method");
}
- if (mid == init && !FL_TEST(klass, FL_SINGLETON) && nd_type(node) != NODE_ZSUPER) {
+ if (mid == init && !FL_TEST(klass, FL_SINGLETON) && node && nd_type(node) != NODE_ZSUPER) {
noex = NOEX_PRIVATE | (noex & NOEX_NOSUPER);
}
if (OBJ_FROZEN(klass)) rb_error_frozen("class/module");