summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-07 04:45:16 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-07 04:45:16 +0000
commitcac2f455a9ed5df1827ebfa1ea6fd54ce41f178f (patch)
treee41a629235c1e82abc7d6ce6b30d30dbb38ccb2f
parentb309a3698de74e3cf97b5c3d9393c9d3e735f469 (diff)
* ext/json/fbuffer/fbuffer.h (fbuffer_append_str): change the place of
RB_GC_GUARD. it should be after the object is used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/json/fbuffer/fbuffer.h4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index a3fc2a7749..90474f1daf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Jun 7 13:25:27 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/json/fbuffer/fbuffer.h (fbuffer_append_str): change the place of
+ RB_GC_GUARD. it should be after the object is used.
+
Fri Jun 7 13:22:43 2013 NARUSE, Yui <naruse@ruby-lang.org>
* gc.c (before_gc_sweep): noinline can also avoid the segv instead of
diff --git a/ext/json/fbuffer/fbuffer.h b/ext/json/fbuffer/fbuffer.h
index af74187566..24bb088521 100644
--- a/ext/json/fbuffer/fbuffer.h
+++ b/ext/json/fbuffer/fbuffer.h
@@ -117,9 +117,9 @@ static void fbuffer_append_str(FBuffer *fb, VALUE str)
const char *newstr = StringValuePtr(str);
unsigned long len = RSTRING_LEN(str);
- RB_GC_GUARD(str);
-
fbuffer_append(fb, newstr, len);
+
+ RB_GC_GUARD(str);
}
#endif