1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Separate RSTRING_PTR from a function call

Do not apply RSTRING_PTR, a macro which evaluats its argument
multiple times, on a function call.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-12-13 05:09:58 +00:00
parent 589042c063
commit 21d99677f6

View file

@ -6661,7 +6661,9 @@ tmx_m_of(union DateData *x)
static char *
tmx_m_zone(union DateData *x)
{
return RSTRING_PTR(m_zone(x));
VALUE zone = m_zone(x);
/* TODO: fix potential dangling pointer */
return RSTRING_PTR(zone);
}
static const struct tmx_funcs tmx_funcs = {