diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-06-11 07:02:23 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-06-11 07:02:23 +0000 |
commit | 22010642b24f2b3f2bfef1324c61764dcd8cc2fd (patch) | |
tree | dd8a8256032a8c6ef07ac3ae8c6464c11282f104 /eval.c | |
parent | a5fd4cec841d2ae50d2aaff8f564da4842d0984c (diff) | |
download | ruby-22010642b24f2b3f2bfef1324c61764dcd8cc2fd.tar.gz |
* eval.c (rb_eval): ruby_frame->last_func may be null, if it's
called outside of a method.
* parse.y (arg): use INT2NUM, not INT2FIX for tUMINUS.
* parse.y (arg): unnecessary negative tPOW treatment.
* parse.y (tokadd_escape): wrong backslash escapement.
* parse.y (stmt,arg): too much void value check.
* parse.y (stmt,arg): need to check void value on rules which does
not use node_assign().
* ext/socket/socket.c (ipaddr): need not to taint hostnames.
* range.c (range_include): should be based on "<=>", whereas
member? still is based on "each".
* range.c (range_min,range_max): redefine methods based on "<=>".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -2745,9 +2745,14 @@ rb_eval(self, n) TMP_PROTECT; if (ruby_frame->last_class == 0) { - rb_name_error(ruby_frame->last_func, - "superclass method `%s' disabled", - rb_id2name(ruby_frame->last_func)); + if (ruby_frame->last_func) { + rb_name_error(ruby_frame->last_func, + "superclass method `%s' disabled", + rb_id2name(ruby_frame->last_func)); + } + else { + rb_raise(rb_eNoMethodError, "super called outside of method"); + } } if (nd_type(node) == NODE_ZSUPER) { argc = ruby_frame->argc; |