1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* eval.c (eval): warning during eval should not cause deadlock.

[ruby-talk:98651]

* eval.c (rb_eval): raise TypeError exception for superclass
  mismatch.  [ruby-dev:39567]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2004-05-10 08:23:13 +00:00
parent 4b9e46d95d
commit ae3241dcfe
4 changed files with 16 additions and 5 deletions

View file

@ -1,3 +1,11 @@
Mon May 10 16:45:21 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (eval): warning during eval should not cause deadlock.
[ruby-talk:98651]
* eval.c (rb_eval): raise TypeError exception for superclass
mismatch. [ruby-dev:39567]
Mon May 10 12:11:37 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/generators/html_generator.rb: Hack to search parents

9
eval.c
View file

@ -3791,7 +3791,8 @@ rb_eval(self, n)
if (super) {
tmp = rb_class_real(RCLASS(klass)->super);
if (tmp != super) {
goto override_class;
rb_raise(rb_eTypeError, "superclass mismatch for class %s",
rb_id2name(cname));
}
super = 0;
}
@ -3800,7 +3801,6 @@ rb_eval(self, n)
}
}
else {
override_class:
if (!super) super = rb_cObject;
klass = rb_define_class_id(cname, super);
rb_set_class_path(klass, cbase, rb_id2name(cname));
@ -6011,6 +6011,7 @@ eval(self, src, scope, file, line)
struct FRAME frame;
NODE *nodesave = ruby_current_node;
volatile int iter = ruby_frame->iter;
volatile int safe = ruby_safe_level;
int state;
if (!NIL_P(scope)) {
@ -6064,6 +6065,7 @@ eval(self, src, scope, file, line)
if ((state = EXEC_TAG()) == 0) {
NODE *node;
ruby_safe_level = 0;
result = ruby_errinfo;
ruby_errinfo = Qnil;
node = compile(src, file, line);
@ -6076,6 +6078,7 @@ eval(self, src, scope, file, line)
POP_TAG();
POP_CLASS();
ruby_in_eval--;
ruby_safe_level = safe;
if (!NIL_P(scope)) {
int dont_recycle = ruby_scope->flags & SCOPE_DONT_RECYCLE;
@ -6112,7 +6115,7 @@ eval(self, src, scope, file, line)
errat = get_backtrace(ruby_errinfo);
mesg = rb_attr_get(ruby_errinfo, rb_intern("mesg"));
if (!NIL_P(errat) && TYPE(errat) == T_ARRAY) {
if (!NIL_P(errat) && TYPE(errat) == T_ARRAY) {
if (!NIL_P(mesg) && TYPE(mesg) == T_STRING) {
rb_str_update(mesg, 0, 0, rb_str_new2(": "));
rb_str_update(mesg, 0, 0, RARRAY(errat)->ptr[0]);

View file

@ -218,7 +218,7 @@ void rb_thread_interrupt _((void));
void rb_thread_trap_eval _((VALUE, int));
void rb_thread_signal_raise _((char*));
int rb_thread_select _((int, fd_set *, fd_set *, fd_set *, struct timeval *));
void rb_thread_wait_for _((struct timeval time));
void rb_thread_wait_for _((struct timeval));
VALUE rb_thread_current _((void));
VALUE rb_thread_main _((void));
VALUE rb_thread_local_aref _((VALUE, ID));

View file

@ -502,7 +502,7 @@ flo_to_s(flt)
avalue = fabs(value);
if (avalue < 1.0e-7 || avalue >= 1.0e15) {
fmt = "%.16e";
fmt = "%.15e";
}
sprintf(buf, fmt, value);
if (!(e = strchr(buf, 'e'))) {