diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-13 05:09:58 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-13 05:09:58 +0000 |
commit | 21d99677f6351d632d413198f0df7c9558de7e2f (patch) | |
tree | c06358d42241844754a7f98ac2be1b4d9f4d11c5 /ext | |
parent | 589042c06319e854b4a23e609fc574f34d4ff197 (diff) |
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
Diffstat (limited to 'ext')
-rw-r--r-- | ext/date/date_core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/date/date_core.c b/ext/date/date_core.c index e61d952cbf..49027e92b1 100644 --- a/ext/date/date_core.c +++ b/ext/date/date_core.c @@ -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 = { |