ruby-changes:8963
From: yugui <ko1@a...>
Date: Thu, 4 Dec 2008 17:55:39 +0900 (JST)
Subject: [ruby-changes:8963] Ruby:r20498 (ruby_1_9_1): merges r20460 from trunk into ruby_1_9_1.
yugui 2008-12-04 17:54:47 +0900 (Thu, 04 Dec 2008) New Revision: 20498 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20498 Log: merges r20460 from trunk into ruby_1_9_1. * ext/tk/tcltklib.c (ip_ruby_cmd, ip_invoke_with_position): must not access internal union directly. [ruby-list:45670] Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/ext/tk/tcltklib.c Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 20497) +++ ruby_1_9_1/ChangeLog (revision 20498) @@ -1,3 +1,8 @@ +Wed Dec 3 14:48:52 2008 Nobuyoshi Nakada <nobu@r...> + + * ext/tk/tcltklib.c (ip_ruby_cmd, ip_invoke_with_position): must + not access internal union directly. [ruby-list:45670] + Wed Dec 3 12:24:08 2008 Nobuyoshi Nakada <nobu@r...> * io.c (rb_io_getc, rb_io_readchar): documentation correction from Index: ruby_1_9_1/ext/tk/tcltklib.c =================================================================== --- ruby_1_9_1/ext/tk/tcltklib.c (revision 20497) +++ ruby_1_9_1/ext/tk/tcltklib.c (revision 20498) @@ -3090,22 +3090,20 @@ /* get args */ args = rb_ary_new2(argc - 2); for(i = 3; i < argc; i++) { + VALUE s; #if TCL_MAJOR_VERSION >= 8 str = Tcl_GetStringFromObj(argv[i], &len); + s = rb_tainted_str_new(str, len); +#else /* TCL_MAJOR_VERSION < 8 */ + str = argv[i]; + s = rb_tainted_str_new2(str); +#endif DUMP2("arg:%s",str); #ifndef HAVE_STRUCT_RARRAY_LEN - rb_ary_push(args, rb_tainted_str_new(str, len)); + rb_ary_push(args, s); #else - RARRAY(args)->as.heap.ptr[RARRAY(args)->as.heap.len++] = rb_tainted_str_new(str, len); + RARRAY(args)->ptr[RARRAY(args)->len++] = s; #endif -#else /* TCL_MAJOR_VERSION < 8 */ - DUMP2("arg:%s",argv[i]); -#ifndef HAVE_STRUCT_RARRAY_LEN - rb_ary_push(args, rb_tainted_str_new2(argv[i])); -#else - RARRAY(args)->as.heap.ptr[RARRAY(args)->as.heap.len++] = rb_tainted_str_new2(argv[i]); -#endif -#endif } if (old_gc == Qfalse) rb_gc_enable(); @@ -8295,7 +8293,7 @@ DUMP2("back from handler (current thread:%lx)", current); /* get result & free allocated memory */ - ret = RARRAY(result)->as.heap.ptr[0]; + ret = RARRAY_PTR(result)[0]; #if 0 /* use Tcl_EventuallyFree */ Tcl_EventuallyFree((ClientData)alloc_done, TCL_DYNAMIC); /* XXXXXXXX */ #else -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/