summaryrefslogtreecommitdiffstats
path: root/insns.def
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-05 15:01:42 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-05 15:01:42 +0000
commit143d2c0929c2df367894c9f7e5f220e438c87a5e (patch)
treebc4f51441208baf18a4f036ebca84313efff4ae8 /insns.def
parent0110fa16448f6013c6ae415df95302e2b3a7cf1b (diff)
downloadruby-143d2c0929c2df367894c9f7e5f220e438c87a5e.tar.gz
ruby-143d2c0929c2df367894c9f7e5f220e438c87a5e.tar.xz
ruby-143d2c0929c2df367894c9f7e5f220e438c87a5e.zip
* compile.c (iseq_compile_each): should call compile_cpath() for
modules as well. [ruby-dev:34585] * insns.def (defineclass): add undef handling. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'insns.def')
-rw-r--r--insns.def5
1 files changed, 4 insertions, 1 deletions
diff --git a/insns.def b/insns.def
index ba7beec33..0850fab32 100644
--- a/insns.def
+++ b/insns.def
@@ -972,8 +972,11 @@ defineclass
case 2:
/* val is dummy. classdef returns class scope value */
/* super is dummy */
- if (cbase == Qnil) {
+ if (cbase == Qundef) {
cbase = vm_get_cbase(th);
+ if (NIL_P(cbase)) {
+ rb_raise(rb_eTypeError, "no class/module to define constant");
+ }
}
vm_check_if_namespace(cbase);