logo       


Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

[ruby-dev:27357] Re: possible SEGV in rb_autoload_load?: msg#00423

Subject: [ruby-dev:27357] Re: possible SEGV in rb_autoload_load?
なかだです。

At Wed, 28 Sep 2005 19:28:19 +0900,
H.Yamamoto wrote in [ruby-dev:27351]:
> >こっちはなぜか手元では const_missing() の戻り値を使うように直し
> >てありました。

理由を思い出せなかったので、もう一度よく考えてみましたが、

> const_missing が何をしているのかもよくわかってないので、お任せ
> したいです。

ここはconst_missing()を呼ばずにそのままreturnしたほうがいいとい
う気がして来ました。const_missing()は、そのあと最終的に見付から
なかった場合にだけ呼ばれるべきではないかと。


Index: eval.c
===================================================================
RCS file: /cvs/ruby/src/ruby/eval.c,v
retrieving revision 1.832
diff -U2 -p -r1.832 eval.c
--- eval.c      20 Sep 2005 09:26:03 -0000      1.832
+++ eval.c      28 Sep 2005 14:28:31 -0000
@@ -1796,5 +1796,5 @@ ev_const_get(NODE *cref, ID id, VALUE se
        while (RCLASS(klass)->iv_tbl && st_lookup(RCLASS(klass)->iv_tbl, id, 
&result)) {
            if (result == Qundef) {
-               rb_autoload_load(klass, id);
+               if (!RTEST(rb_autoload_load(klass, id))) break;
                continue;
            }
Index: intern.h
===================================================================
RCS file: /cvs/ruby/src/ruby/intern.h,v
retrieving revision 1.182
diff -U2 -p -r1.182 intern.h
--- intern.h    14 Sep 2005 08:30:15 -0000      1.182
+++ intern.h    28 Sep 2005 14:30:24 -0000
@@ -532,5 +532,5 @@ void rb_name_class(VALUE, ID);
 VALUE rb_class_name(VALUE);
 void rb_autoload(VALUE, ID, const char*);
-void rb_autoload_load(VALUE, ID);
+VALUE rb_autoload_load(VALUE, ID);
 VALUE rb_autoload_p(VALUE, ID);
 void rb_gc_mark_global_tbl(void);
Index: variable.c
===================================================================
RCS file: /cvs/ruby/src/ruby/variable.c,v
retrieving revision 1.128
diff -U2 -p -r1.128 variable.c
--- variable.c  24 Sep 2005 00:17:41 -0000      1.128
+++ variable.c  28 Sep 2005 14:28:43 -0000
@@ -1216,5 +1216,5 @@ autoload_delete(VALUE mod, ID id)
 }
 
-void
+VALUE
 rb_autoload_load(VALUE klass, ID id)
 {
@@ -1223,7 +1223,7 @@ rb_autoload_load(VALUE klass, ID id)
 
     if (!load || !(file = load->nd_lit) || rb_provided(RSTRING(file)->ptr)) {
-       const_missing(klass, id);
+       return Qfalse;
     }
-    rb_require_safe(file, load->nd_nth);
+    return rb_require_safe(file, load->nd_nth);
 }
 
@@ -1284,5 +1284,5 @@ rb_const_get_0(VALUE klass, ID id, int e
        while (RCLASS(tmp)->iv_tbl && st_lookup(RCLASS(tmp)->iv_tbl,id,&value)) 
{
            if (value == Qundef) {
-               rb_autoload_load(tmp, id);
+               if (!RTEST(rb_autoload_load(tmp, id))) break;
                continue;
            }


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




Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
db.firebase.por...    text.xml.xalan....    qnx.openqnx.dev...    user-groups.zar...    internationaliz...    kde.devel.konve...    finance.e-gold....    emacs.latex.pre...    gis.therion/200...    web.webmin.gene...    yellowdog.gener...    vserver/2003-08...    redhat.release....    sysutils.tivoli...    xfree86.expert/...    mail.becky.user...    hardware.netapp...    netbsd.ports.xe...    python.distutil...    boot-loaders.gr...    culture.interne...    java.springfram...    activedir/2006-...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe