[#30872] segv when reentering into Fiber with callcc — sheepman <sheepman@...>

こんばんは、sheepman です。

15 messages 2007/06/01
[#30899] Re: segv when reentering into Fiber with callcc — SASADA Koichi <ko1@...> 2007/06/06

 ささだです。

[#30905] Re: segv when reentering into Fiber with callcc — "Yusuke ENDOH" <mame@...> 2007/06/06

遠藤と申します。

[#30906] Re: segv when reentering into Fiber with callcc — SASADA Koichi <ko1@...> 2007/06/06

 ささだです。

[#30929] secrand.rb — "NAKAMURA, Hiroshi" <nakahiro@...>

-----BEGIN PGP SIGNED MESSAGE-----

51 messages 2007/06/08
[#30930] Re: secrand.rb — Tanaka Akira <akr@...> 2007/06/08

In article <4669066C.2080307@sarion.co.jp>,

[#30934] Re: secrand.rb — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/06/08

-----BEGIN PGP SIGNED MESSAGE-----

[#30935] Re: secrand.rb — Tanaka Akira <akr@...> 2007/06/08

In article <46694461.4060706@sarion.co.jp>,

[#30936] Re: secrand.rb — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/06/08

-----BEGIN PGP SIGNED MESSAGE-----

[#30938] Re: secrand.rb — Tanaka Akira <akr@...> 2007/06/08

In article <46697C0B.8060402@sarion.co.jp>,

[#30939] Re: secrand.rb — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/06/08

-----BEGIN PGP SIGNED MESSAGE-----

[#30940] Re: secrand.rb — Tanaka Akira <akr@...> 2007/06/08

In article <4669DAB0.4050705@sarion.co.jp>,

[#30944] Re: secrand.rb — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/06/09

-----BEGIN PGP SIGNED MESSAGE-----

[#30945] Re: secrand.rb — Tanaka Akira <akr@...> 2007/06/09

In article <466AA73C.9030407@sarion.co.jp>,

[#30946] Re: secrand.rb — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/06/09

-----BEGIN PGP SIGNED MESSAGE-----

[#30950] Re: secrand.rb — Nobuyoshi Nakada <nobu@...> 2007/06/11

なかだです。

[#31173] Re: Random — Tanaka Akira <akr@...> 2007/07/10

In article <469253E9.9010203@sarion.co.jp>,

[#31174] Re: Random — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/07/10

-----BEGIN PGP SIGNED MESSAGE-----

[#31178] Re: Random — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/07/11

-----BEGIN PGP SIGNED MESSAGE-----

[#31179] Re: Random — Tanaka Akira <akr@...> 2007/07/11

In article <4694338C.7090303@sarion.co.jp>,

[#31183] Re: Random — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/07/11

-----BEGIN PGP SIGNED MESSAGE-----

[#30971] Linux/ia64で'ucontext_t' undeclared — akira yamada / やまだあきら <akira@...>

最近のRuby 1.9をLinux/ia64上でmakeしようとすると

16 messages 2007/06/13
[#30973] Re: Linux/ia64で'ucontext_t' undeclared — Yukihiro Matsumoto <matz@...> 2007/06/13

まつもと ゆきひろです

[#30974] Re: Linux/ia64で'ucontext_t' undeclared — akira@... 2007/06/13

Yukihiro Matsumoto さんは書きました:

[#30975] Re: Linux/ia64で'ucontext_t' undeclared — Yukihiro Matsumoto <matz@...> 2007/06/13

まつもと ゆきひろです

[ruby-dev:31034] Re: [ruby-cvs:19815] Ruby:r12579 (trunk): * parse.y (rb_intern2): name may not be NUL-terminated.

From: "U.Nakamura" <usa@...>
Date: 2007-06-21 11:40:05 UTC
List: ruby-dev #31034
こんにちは、なかむら(う)です。

In message "[ruby-cvs:19815] Ruby:r12579 (trunk): * parse.y (rb_intern2): name may not be NUL-terminated."
    on Jun.21,2007 17:12:32, <nobu@ruby-lang.org> wrote:
|   Log:
|     * parse.y (rb_intern2): name may not be NUL-terminated.

mをnameと関係ないポインタに変えていますが、後ろの方のwhileル
ープでmとname + lastを比較してるので正常に動作しなくなってい
ます。
その部分を直したのと、あとついでにmを取得した後はnameをもう見
ないようにしてみました。

Index: parse.y
===================================================================
--- parse.y	(revision 12580)
+++ parse.y	(working copy)
@@ -8421,7 +8421,7 @@ ID
 rb_intern2(const char *name, long len)
 {
     VALUE str = rb_str_new(name, len);
-    const char *m = RSTRING_PTR(str);
+    const char *m = RSTRING_PTR(str), *end;
     ID id;
     int last;
 
@@ -8429,46 +8429,46 @@ rb_intern2(const char *name, long len)
 	return id;
 
     last = len-1;
+    end = m + last;
     id = 0;
-    switch (*name) {
+    switch (*m) {
       case '$':
 	id |= ID_GLOBAL;
 	if (is_special_global_name(++m)) goto new_id;
 	break;
       case '@':
-	if (name[1] == '@') {
+	if (*++m == '@') {
 	    m++;
 	    id |= ID_CLASS;
 	}
 	else {
 	    id |= ID_INSTANCE;
 	}
-	m++;
 	break;
       default:
-	if (name[0] != '_' && ISASCII(name[0]) && !ISALNUM(name[0])) {
+	if (*m != '_' && ISASCII(*m) && !ISALNUM(*m)) {
 	    /* operators */
 	    int i;
 
 	    for (i=0; op_tbl[i].token; i++) {
-		if (*op_tbl[i].name == *name &&
-		    strcmp(op_tbl[i].name, name) == 0) {
+		if (*op_tbl[i].name == *m &&
+		    strcmp(op_tbl[i].name, m) == 0) {
 		    id = op_tbl[i].token;
 		    goto id_register;
 		}
 	    }
 	}
 
-	if (name[last] == '=') {
+	if (*end == '=') {
 	    /* attribute assignment */
-	    id = rb_intern2(name, last);
+	    id = rb_intern2(m, last);
 	    if (id > tLAST_TOKEN && !is_attrset_id(id)) {
 		id = rb_id_attrset(id);
 		goto id_register;
 	    }
 	    id = ID_ATTRSET;
 	}
-	else if (ISUPPER(name[0])) {
+	else if (ISUPPER(*m)) {
 	    id = ID_CONST;
         }
 	else {
@@ -8477,7 +8477,7 @@ rb_intern2(const char *name, long len)
 	break;
     }
     if (!ISDIGIT(*m)) {
-	while (m <= name + last && is_identchar(*m)) {
+	while (m <= end && is_identchar(*m)) {
 	    m += mbclen(*m);
 	}
     }

それでは。
-- 
U.Nakamura <usa@garbagecollect.jp>



In This Thread

Prev Next