Revision
4511
Author
lsansonetti@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

Diff

Modified: MacRuby/trunk/vm.cpp (4510 => 4511)


--- 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);