[macruby-changes] [4511] MacRuby/trunk/vm.cpp

source_changes at macosforge.org source_changes at macosforge.org
Mon Sep 13 14:38:11 PDT 2010


Revision: 4511
          http://trac.macosforge.org/projects/ruby/changeset/4511
Author:   lsansonetti at apple.com
Date:     2010-09-13 14:38:09 -0700 (Mon, 13 Sep 2010)
Log Message:
-----------
don't crash when using defined?(super) out of a method block

Modified Paths:
--------------
    MacRuby/trunk/vm.cpp

Modified: MacRuby/trunk/vm.cpp
===================================================================
--- MacRuby/trunk/vm.cpp	2010-09-13 21:18:42 UTC (rev 4510)
+++ MacRuby/trunk/vm.cpp	2010-09-13 21:38:09 UTC (rev 4511)
@@ -1605,6 +1605,10 @@
 		if (type == DEFINED_SUPER) {
 		    klass = RCLASS_SUPER(klass);
 		}
+		if (what == 0) {
+		    rb_raise(rb_eRuntimeError,
+			    "defined?(super) out of a method block isn't supported");
+		}
 		const char *idname = rb_id2name((ID)what);
 		SEL sel = sel_registerName(idname);
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100913/7a9f8099/attachment.html>


More information about the macruby-changes mailing list