mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/tk/tcltklib.c (ip_ruby_cmd, ip_invoke_with_position): must
not access internal union directly. [ruby-list:45670] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f71dcc1b54
commit
13424f32fe
2 changed files with 14 additions and 11 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Wed Dec 3 14:48:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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@ruby-lang.org>
|
Wed Dec 3 12:24:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* io.c (rb_io_getc, rb_io_readchar): documentation correction from
|
* io.c (rb_io_getc, rb_io_readchar): documentation correction from
|
||||||
|
|
|
@ -3090,21 +3090,19 @@ ip_ruby_cmd(clientData, interp, argc, argv)
|
||||||
/* get args */
|
/* get args */
|
||||||
args = rb_ary_new2(argc - 2);
|
args = rb_ary_new2(argc - 2);
|
||||||
for(i = 3; i < argc; i++) {
|
for(i = 3; i < argc; i++) {
|
||||||
|
VALUE s;
|
||||||
#if TCL_MAJOR_VERSION >= 8
|
#if TCL_MAJOR_VERSION >= 8
|
||||||
str = Tcl_GetStringFromObj(argv[i], &len);
|
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);
|
DUMP2("arg:%s",str);
|
||||||
#ifndef HAVE_STRUCT_RARRAY_LEN
|
#ifndef HAVE_STRUCT_RARRAY_LEN
|
||||||
rb_ary_push(args, rb_tainted_str_new(str, len));
|
rb_ary_push(args, s);
|
||||||
#else
|
#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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8295,7 +8293,7 @@ ip_invoke_with_position(argc, argv, obj, position)
|
||||||
DUMP2("back from handler (current thread:%lx)", current);
|
DUMP2("back from handler (current thread:%lx)", current);
|
||||||
|
|
||||||
/* get result & free allocated memory */
|
/* get result & free allocated memory */
|
||||||
ret = RARRAY(result)->as.heap.ptr[0];
|
ret = RARRAY_PTR(result)[0];
|
||||||
#if 0 /* use Tcl_EventuallyFree */
|
#if 0 /* use Tcl_EventuallyFree */
|
||||||
Tcl_EventuallyFree((ClientData)alloc_done, TCL_DYNAMIC); /* XXXXXXXX */
|
Tcl_EventuallyFree((ClientData)alloc_done, TCL_DYNAMIC); /* XXXXXXXX */
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue