[#27919] 1.8.4 Preview2 検証 — "URABE Shyouhei aka. mput" <root@...>

卜部です。

33 messages 2005/12/01

[#27997] 1.8.4 documents? — "URABE Shyouhei aka. mput" <root@...>

卜部です。

22 messages 2005/12/12
[#28017] Re: 1.8.4 documents? — Koji Arai <jca02266@...> 2005/12/13

新井です。

[#28082] ruby_1_8 Segmentation fault on Cygwin — yanagi@...

柳田です。

13 messages 2005/12/21
[#28083] Re: ruby_1_8 Segmentation fault on Cygwin — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/12/21

山本です。

[#28140] ia64-hpux11.23/socket.sl: this executable file can't load extension libraries (LoadError) — Tanaka Akira <akr@...17n.org>

HP-UX で HP aC++/ANSI C を使って作った ruby で、openssl や drb のテストをすると、

34 messages 2005/12/27
[#28141] Re: ia64-hpux11.23/socket.sl: this executable file can't load extension libraries (LoadError) — WATANABE Tetsuya <Tetsuya.WATANABE@...> 2005/12/28

渡辺哲也です。

[#28142] Re: ia64-hpux11.23/socket.sl: this executable file can't load extension libraries (LoadError) — Tanaka Akira <akr@...17n.org> 2005/12/28

In article <200512280307.jBS37nnj005909@pbsg500.nifty.com>,

[#28147] Re: ia64-hpux11.23/socket.sl: this executable file can't load extension libraries (LoadError) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/12/28

山本です。

[#28149] Re: ia64-hpux11.23/socket.sl: this executable file can't load extension libraries (LoadError) — Tanaka Akira <akr@...17n.org> 2005/12/28

In article <20051228210640.13C71A10.ocean@m2.ccsnet.ne.jp>,

[#28151] Re: ia64-hpux11.23/socket.sl: this executable file can't load extension libraries (LoadError) — WATANABE Tetsuya <Tetsuya.WATANABE@...> 2005/12/29

渡辺哲也です。

[#28152] Re: ia64-hpux11.23/socket.sl: this executable file can't load extensionlibraries (LoadError) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/12/29

山本です。

[#28153] Re: ia64-hpux11.23/socket.sl: this executable file can't load extensionlibraries (LoadError) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/12/29

山本です。

[#28154] thread based generator.rb — Tanaka Akira <akr@...17n.org> 2005/12/29

In article <20051229114438.44D19F00.ocean@m2.ccsnet.ne.jp>,

[ruby-dev:27978] Re: rb_funcall2() for protected method

From: nobuyoshi nakada <nobuyoshi.nakada@...>
Date: 2005-12-09 09:08:54 UTC
List: ruby-dev #27978
なかだです。

At Thu, 1 Dec 2005 00:27:27 +0900,
Yukihiro Matsumoto wrote in [ruby-dev:27902]:
> |抜け道がほしいというか、少なくとも今のrb_call()でのprotectedに
> |対するチェックはrb_funcall2()に関しては不適切ではないかと思うの
> |ですが。Cレベルで別のオブジェクトのコンテキストで評価していても、
> |ruby_frameに反映されるわけではないので。
> 
> なるほど。でも、その場合でもscopeを流用するのは違うんじゃな
> いかなあ。あー、でも関数的呼び出しの場合にはprotectedの呼び
> 出しは必ず成功するわけだし問題ないのか...。
> 
> 納得しました。コミットしてください。1.8にも。

[ruby-talk:169057]の件はどうしましょうか。

# && が一つ余分なのであのパッチだとコンパイルできませんが。

ついでに、マジックナンバーに名前を付けてみました。こっちは1.9用です。


Index: eval.c
===================================================================
RCS file: /cvs/ruby/src/ruby/eval.c,v
retrieving revision 1.850
diff -U2 -p -r1.850 eval.c
--- eval.c	7 Dec 2005 17:07:51 -0000	1.850
+++ eval.c	9 Dec 2005 02:43:40 -0000
@@ -1013,5 +1013,13 @@ static VALUE rb_yield_0(VALUE, VALUE, VA
 #define YIELD_FUNC_SVALUE 2
 
-static VALUE rb_call(VALUE,VALUE,ID,int,const VALUE*,int);
+typedef enum calling_scope {
+    CALLING_NORMAL,
+    CALLING_FCALL,
+    CALLING_VCALL,
+    CALLING_SUPER,
+    CALLING_INTERNAL,
+} calling_scope_t;
+
+static VALUE rb_call(VALUE,VALUE,ID,int,const VALUE*,calling_scope_t);
 static VALUE module_setup(VALUE,NODE*);
 
@@ -2989,5 +2997,5 @@ rb_eval(VALUE self, NODE *n)
 		    ruby_current_node = node;
 		    SET_CURRENT_SOURCE();
-		    result = rb_call(CLASS_OF(recv),recv,each,0,0,0);
+		    result = rb_call(CLASS_OF(recv),recv,each,0,0,CALLING_NORMAL);
 		}
 		POP_ITER();
@@ -3215,5 +3223,5 @@ rb_eval(VALUE self, NODE *n)
 	    VALUE recv;
 	    int argc; VALUE *argv; /* used in SETUP_ARGS */
-	    int scope;
+	    calling_scope_t scope;
 	    TMP_PROTECT;
 
@@ -3221,9 +3229,9 @@ rb_eval(VALUE self, NODE *n)
 	    if (node->nd_recv == (NODE *)1) {
 		recv = self;
-		scope = 1;
+		scope = CALLING_FCALL;
 	    }
 	    else {
 		recv = rb_eval(self, node->nd_recv);
-		scope = 0;
+		scope = CALLING_NORMAL;
 	    }
 	    SETUP_ARGS(node->nd_args);
@@ -3250,5 +3258,5 @@ rb_eval(VALUE self, NODE *n)
 	    ruby_current_node = node;
 	    SET_CURRENT_SOURCE();
-	    result = rb_call(CLASS_OF(recv),recv,node->nd_mid,argc,argv,0);
+	    result = rb_call(CLASS_OF(recv),recv,node->nd_mid,argc,argv,CALLING_NORMAL);
 	}
 	break;
@@ -3265,5 +3273,5 @@ rb_eval(VALUE self, NODE *n)
 	    ruby_current_node = node;
 	    SET_CURRENT_SOURCE();
-	    result = rb_call(CLASS_OF(self),self,node->nd_mid,argc,argv,1);
+	    result = rb_call(CLASS_OF(self),self,node->nd_mid,argc,argv,CALLING_FCALL);
 	}
 	break;
@@ -3271,5 +3279,5 @@ rb_eval(VALUE self, NODE *n)
       case NODE_VCALL:
 	SET_CURRENT_SOURCE();
-	result = rb_call(CLASS_OF(self),self,node->nd_mid,0,0,2);
+	result = rb_call(CLASS_OF(self),self,node->nd_mid,0,0,CALLING_VCALL);
 	break;
 
@@ -5039,12 +5047,12 @@ assign(VALUE self, NODE *lhs, VALUE val,
 	{
 	    VALUE recv;
-	    int scope;
+	    calling_scope_t scope;
 	    if (lhs->nd_recv == (NODE *)1) {
 		recv = self;
-		scope = 1;
+		scope = CALLING_FCALL;
 	    }
 	    else {
 		recv = rb_eval(self, lhs->nd_recv);
-		scope = 0;
+		scope = CALLING_NORMAL;
 	    }
 	    if (!lhs->nd_args) {
@@ -5741,6 +5749,5 @@ rb_call0(VALUE klass, VALUE recv, ID id,
 static VALUE
 rb_call(VALUE klass, VALUE recv, ID mid,
-    int argc /* OK */, const VALUE *argv /* OK */, int scope)
-    /* scope: 0=normal, 1=functional style, 2=variable style */
+    int argc /* OK */, const VALUE *argv /* OK */, calling_scope_t scope)
 {
     NODE  *body;		/* OK */
@@ -5757,5 +5764,5 @@ rb_call(VALUE klass, VALUE recv, ID mid,
     if (ent->mid == mid && ent->klass == klass) {
 	if (!ent->method)
-	    return method_missing(recv, mid, argc, argv, scope==2?CSTAT_VCALL:0);
+	    return method_missing(recv, mid, argc, argv, scope==CALLING_VCALL?CSTAT_VCALL:0);
 	klass = ent->origin;
 	id    = ent->mid0;
@@ -5764,17 +5771,17 @@ rb_call(VALUE klass, VALUE recv, ID mid,
     }
     else if ((body = rb_get_method_body(&klass, &id, &noex)) == 0) {
-	if (scope == 3) {
+	if (scope == CALLING_SUPER) {
 	    return method_missing(recv, mid, argc, argv, CSTAT_SUPER);
 	}
-	return method_missing(recv, mid, argc, argv, scope==2?CSTAT_VCALL:0);
+	return method_missing(recv, mid, argc, argv, scope==CALLING_VCALL?CSTAT_VCALL:0);
     }
 
-    if (mid != missing && scope == 0) {
+    if (mid != missing) {
 	/* receiver specified form for private method */
-	if (noex & NOEX_PRIVATE)
+	if ((noex & NOEX_PRIVATE) && scope == CALLING_NORMAL)
 	    return method_missing(recv, mid, argc, argv, CSTAT_PRIV);
 
 	/* self must be kind of a specified form for protected method */
-	if (noex & NOEX_PROTECTED) {
+	if ((noex & NOEX_PROTECTED) && scope < CALLING_SUPER) {
 	    VALUE defined_class = klass;
 
@@ -5786,5 +5793,5 @@ rb_call(VALUE klass, VALUE recv, ID mid,
 	}
     }
-    if (scope > 0) {		/* pass receiver info */
+    if (scope > CALLING_NORMAL) { /* pass receiver info */
 	noex |= NOEX_RECV;
     }
@@ -5801,9 +5808,9 @@ rb_apply(VALUE recv, ID mid, VALUE args)
     argv = ALLOCA_N(VALUE, argc);
     MEMCPY(argv, RARRAY(args)->ptr, VALUE, argc);
-    return rb_call(CLASS_OF(recv), recv, mid, argc, argv, 1);
+    return rb_call(CLASS_OF(recv), recv, mid, argc, argv, CALLING_FCALL);
 }
 
 static VALUE
-send_funcall(int argc, VALUE *argv, VALUE recv, int scope)
+send_funcall(int argc, VALUE *argv, VALUE recv, calling_scope_t scope)
 {
     VALUE vid;
@@ -5845,5 +5852,5 @@ static VALUE
 rb_f_send(int argc, VALUE *argv, VALUE recv)
 {
-    int scope = (ruby_frame->flags & FRAME_FUNC) ? 1 : 0;
+    calling_scope_t scope = (ruby_frame->flags & FRAME_FUNC) ? CALLING_FCALL : CALLING_NORMAL;
 
     return send_funcall(argc, argv, recv, scope);
@@ -5865,5 +5872,5 @@ static VALUE
 rb_f_funcall(int argc, VALUE *argv, VALUE recv)
 {
-    return send_funcall(argc, argv, recv, 1);
+    return send_funcall(argc, argv, recv, CALLING_FCALL);
 }
 
@@ -5889,5 +5896,5 @@ rb_funcall(VALUE recv, ID mid, int n, ..
     }
 
-    return rb_call(CLASS_OF(recv), recv, mid, n, argv, 1);
+    return rb_call(CLASS_OF(recv), recv, mid, n, argv, CALLING_FCALL);
 }
 
@@ -5895,5 +5902,5 @@ VALUE
 rb_funcall2(VALUE recv, ID mid, int argc, const VALUE *argv)
 {
-    return rb_call(CLASS_OF(recv), recv, mid, argc, argv, 1);
+    return rb_call(CLASS_OF(recv), recv, mid, argc, argv, CALLING_INTERNAL);
 }
 
@@ -5901,5 +5908,5 @@ VALUE
 rb_funcall3(VALUE recv, ID mid, int argc, const VALUE *argv)
 {
-    return rb_call(CLASS_OF(recv), recv, mid, argc, argv, 0);
+    return rb_call(CLASS_OF(recv), recv, mid, argc, argv, CALLING_NORMAL);
 }
 
@@ -5921,5 +5928,5 @@ rb_call_super(int argc, const VALUE *arg
 
     PUSH_ITER(ruby_iter->iter ? ITER_PRE : ITER_NOT);
-    result = rb_call(RCLASS(klass)->super, self, ruby_frame->this_func, argc, argv, 3);
+    result = rb_call(RCLASS(klass)->super, self, ruby_frame->this_func, argc, argv, CALLING_SUPER);
     POP_ITER();
 


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

In This Thread