summaryrefslogtreecommitdiffstats
path: root/error.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-11-10 08:52:23 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-11-10 08:52:23 +0000
commitc317efff86a1ebc4bbd61e05c854fc1d5bfb2efe (patch)
tree5eaeb3c02aebf65d16b2eb4583c005e712e0f624 /error.c
parent09317d816881676b968e000ffd60b5fd5c290184 (diff)
downloadruby-c317efff86a1ebc4bbd61e05c854fc1d5bfb2efe.tar.gz
ruby-c317efff86a1ebc4bbd61e05c854fc1d5bfb2efe.tar.xz
ruby-c317efff86a1ebc4bbd61e05c854fc1d5bfb2efe.zip
matz
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'error.c')
-rw-r--r--error.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/error.c b/error.c
index 540e57dd6..34eae0d6b 100644
--- a/error.c
+++ b/error.c
@@ -196,13 +196,13 @@ static struct types {
T_FILE, "File",
T_TRUE, "true",
T_FALSE, "false",
- T_UNDEF, "Symbol", /* :symbol */
- T_UNDEF, "undef", /* internal use: #undef */
+ T_SYMBOL, "Symbol", /* :symbol */
T_DATA, "Data", /* internal use: wrapped C pointers */
T_MATCH, "Match", /* data of $~ */
T_VARMAP, "Varmap", /* internal use: dynamic variables */
T_SCOPE, "Scope", /* internal use: variable scope */
T_NODE, "Node", /* internal use: syntax tree node */
+ T_UNDEF, "undef", /* internal use: #undef; should not happen */
-1, 0,
};
@@ -212,9 +212,12 @@ rb_check_type(x, t)
int t;
{
struct types *type = builtin_types;
- int tt = TYPE(x);
- if (tt != t) {
+ if (x == Qundef) {
+ rb_bug("undef leaked to the Ruby space");
+ }
+
+ if (TYPE(x) != t) {
while (type->type >= 0) {
if (type->type == t) {
char *etype;