From: Eric Wong Date: 2011-08-09T08:46:53+09:00 Subject: [ruby-core:38862] [Ruby 1.9 - Bug #5172][Open] [PATCH] bigdecimal: RB_GC_GUARD rb_inspect() output Issue #5172 has been reported by Eric Wong. ---------------------------------------- Bug #5172: [PATCH] bigdecimal: RB_GC_GUARD rb_inspect() output http://redmine.ruby-lang.org/issues/5172 Author: Eric Wong Status: Open Priority: Normal Assignee: Category: ext Target version: 1.9.x ruby -v: ruby 1.9.4dev (2011-08-07 trunk 32885) [x86_64-linux] ext/bigdecimal/bigdecimal.c: RB_GC_GUARD rb_inspect() output We can't directly use RSTRING_PTR() on rb_inspect() because the GC may collect the VALUE returned by rb_inspect(). This is a problem for Symbols with long names that return non-embedded Strings when inspected. test/bigdecimal/test_bigdecimal.rb (test_gc): updated for BigDecimal#coerce test/bigdecimal/test_bigmath.rb (test_gc): added test case -- http://redmine.ruby-lang.org