summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-12 09:07:57 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-12 09:07:57 +0000
commit9da4f78db46764be6dae5e7e83ff48cbecb3fb23 (patch)
treec0805e6c95d6396e28e6129d88905c4dee085f4e /eval.c
parent014f2164ed7031a1c31604b290d2ab0cf1deacdc (diff)
2000-05-12
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/eval.c b/eval.c
index 730b82e59a..7466e587df 100644
--- a/eval.c
+++ b/eval.c
@@ -1362,7 +1362,6 @@ ev_const_set(cref, id, val)
VALUE val;
{
NODE *cbase = cref;
- VALUE tmp;
while (cbase && cbase->nd_clss != rb_cObject) {
struct RClass *klass = RCLASS(cbase->nd_clss);
@@ -2760,9 +2759,12 @@ rb_eval(self, n)
else if (SCOPE_TEST(SCOPE_PROTECTED)) {
noex = NOEX_PROTECTED;
}
- else {
+ else if (ruby_class == rb_cObject) {
noex = node->nd_noex;
}
+ else {
+ noex = NOEX_PUBLIC;
+ }
if (body && origin == ruby_class && body->nd_noex & NOEX_UNDEF) {
noex |= NOEX_UNDEF;
}
@@ -4552,7 +4554,7 @@ rb_f_eval(argc, argv, self)
VALUE *argv;
VALUE self;
{
- VALUE src, scope, vfile, vline, val;
+ VALUE src, scope, vfile, vline;
char *file = "(eval)";
int line = 1;
@@ -4660,7 +4662,7 @@ yield_under_i(self)
if (ruby_block->flags & BLOCK_DYNAMIC) {
struct BLOCK * volatile old_block = ruby_block;
struct BLOCK block;
- volatile VALUE cbase = ruby_block->frame.cbase;
+
/* cbase should be pointed from volatile local variable */
/* to be protected from GC. */
VALUE result;
@@ -4977,9 +4979,8 @@ rb_f_require(obj, fname)
buf = ALLOCA_N(char, strlen(RSTRING(fname)->ptr) + 5);
strcpy(buf, RSTRING(fname)->ptr);
strcat(buf, ".rb");
- file = rb_find_file(buf);
- if (file) {
- fname = rb_str_new2(file);
+ if (rb_find_file(buf)) {
+ fname = rb_str_new2(buf);
feature = buf;
goto load_rb;
}
@@ -6490,8 +6491,9 @@ thread_switch(n)
break;
case RESTORE_NORMAL:
default:
- return 1;
+ break;
}
+ return 1;
}
#define THREAD_SAVE_CONTEXT(th) \