summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 a3fc2a7..90474f1 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 af74187..24bb088 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