summaryrefslogtreecommitdiff
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
commit837c76bd7baee9aaeebd94b4c0719094e1463ff5 (patch)
treebc4f51441208baf18a4f036ebca84313efff4ae8
parent6b1924b176a7a056ba8c703cb2cf2146ab081327 (diff)
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@16299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--compile.c2
-rw-r--r--insns.def5
-rw-r--r--version.h6
4 files changed, 15 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 49e1a45488..ce7364f215 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Tue May 6 00:00:02 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * compile.c (iseq_compile_each): should call compile_cpath() for
+ modules as well. [ruby-dev:34585]
+
+ * insns.def (defineclass): add undef handling.
+
Mon May 5 23:49:40 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* insns.def (defineclass): was using wrong variable. [ruby-dev:34592]
diff --git a/compile.c b/compile.c
index 7b077a30b4..93bcb8a12f 100644
--- a/compile.c
+++ b/compile.c
@@ -4310,7 +4310,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
rb_sprintf("<module:%s>", rb_id2name(node->nd_cpath->nd_mid)),
ISEQ_TYPE_CLASS);
- COMPILE(ret, "mbase", node->nd_cpath->nd_head);
+ compile_cpath(ret, iseq, node->nd_cpath);
ADD_INSN (ret, nd_line(node), putnil); /* dummy */
ADD_INSN3(ret, nd_line(node), defineclass,
ID2SYM(node->nd_cpath->nd_mid), iseqval, INT2FIX(2));
diff --git a/insns.def b/insns.def
index ba7beec33c..0850fab32f 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);
diff --git a/version.h b/version.h
index 5358af259b..c0a1b0043c 100644
--- a/version.h
+++ b/version.h
@@ -1,7 +1,7 @@
#define RUBY_VERSION "1.9.0"
-#define RUBY_RELEASE_DATE "2008-05-05"
+#define RUBY_RELEASE_DATE "2008-05-06"
#define RUBY_VERSION_CODE 190
-#define RUBY_RELEASE_CODE 20080505
+#define RUBY_RELEASE_CODE 20080506
#define RUBY_PATCHLEVEL 0
#define RUBY_VERSION_MAJOR 1
@@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2008
#define RUBY_RELEASE_MONTH 5
-#define RUBY_RELEASE_DAY 5
+#define RUBY_RELEASE_DAY 6
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];