[前][次][番号順一覧][スレッド一覧]

ruby-changes:54156

From: nobu <ko1@a...>
Date: Thu, 13 Dec 2018 14:10:04 +0900 (JST)
Subject: [ruby-changes:54156] nobu:r66377 (trunk): Separate RSTRING_PTR from a function call

nobu	2018-12-13 14:09:58 +0900 (Thu, 13 Dec 2018)

  New Revision: 66377

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66377

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

  Modified files:
    trunk/ext/date/date_core.c
Index: ext/date/date_core.c
===================================================================
--- ext/date/date_core.c	(revision 66376)
+++ ext/date/date_core.c	(revision 66377)
@@ -6661,7 +6661,9 @@ tmx_m_of(union DateData *x) https://github.com/ruby/ruby/blob/trunk/ext/date/date_core.c#L6661
 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 = {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]