[#24112] ruby/tk crashes on bcc32 — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>

山本です。原因を追求してたのですが、力尽きました。

19 messages 2004/08/18
[#24127] Re: ruby/tk crashes on bcc32 — Hidetoshi NAGAI <nagai@...> 2004/08/19

永井@知能.九工大です.

[#24131] Re: ruby/tk crashes on bcc32 — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/08/19

山本です。

[#24135] Re: ruby/tk crashes on bcc32 — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/08/19

山本です。試行錯誤の結果、これで落ちなくなりました。

[ruby-dev:24116] Re: core dump with binding, eval, instance_eval and class variable

From: nobu@...
Date: 2004-08-18 13:14:58 UTC
List: ruby-dev #24116
なかだです。

At Wed, 18 Aug 2004 13:04:56 +0900,
Tanaka Akira wrote in [ruby-dev:24110]:
> > nilだけじゃなくてSPECIAL CONST全般ですね。単純に考えるとこれで
> > いいのではないかと思うのですが。
> 
> test-all で、次のエラーが出るようになったのですが、この副作用は予期さ
> れたものでしょうか?

特異クラスを持てないFixnumやSymbolでも、インスタンス変数は持て
ることを忘れてました。

[ruby-dev:24105]はなしにして、これでどうでしょうか。


Index: eval.c
===================================================================
RCS file: /cvs/ruby/src/ruby/eval.c,v
retrieving revision 1.686
diff -u -2 -p -r1.686 eval.c
--- eval.c	2 Aug 2004 08:52:53 -0000	1.686
+++ eval.c	18 Aug 2004 13:08:08 -0000
@@ -6282,5 +6282,5 @@ eval_under(under, self, src, file, line)
     int line;
 {
-    VALUE args[4];
+    VALUE args[4], cbase = under;
 
     if (ruby_safe_level >= 4) {
@@ -6294,5 +6294,8 @@ eval_under(under, self, src, file, line)
     args[2] = (VALUE)file;
     args[3] = (VALUE)line;
-    return exec_under(eval_under_i, under, under, args);
+    if (NIL_P(cbase) && (self == Qtrue || !RTEST(self))) {
+	cbase = CLASS_OF(self);
+    }
+    return exec_under(eval_under_i, under, cbase, args);
 }
 


-- 
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
    中田 伸悦

In This Thread