Actions
Bug #5199
closedext/tk: RB_GC_GUARD seems to be needed in several places
Description
I noticed the following in ext/tk/tkutil/tkutil.c:
rb_warning("fail to convert '%s' to string for Tk",
RSTRING_PTR(rb_funcall(obj, rb_intern("inspect"), 0,
0)));
id = rb_intern(RSTRING_PTR(rb_str_cat2(rb_str_new2("@"), str)));
I don't use or know the Tk ext at all, but the above examples do not
appear safe from a GC perspective. Compilers can optimize the original
VALUE away entirely so GC can collect.
RSTRING_PTR (being a macro,) may also evaluate its arguments multiple
times.
Files
Actions
Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0