summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-11 21:23:50 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-11 21:23:50 +0000
commite37dc263e5c91f9fd9ab033a5efd40970c20ff1d (patch)
tree2850a4ae242acf4b1c25f36421c55260229f7b96 /compile.c
parentad558ae184116f7c3806c0f420f0ed6a864f9373 (diff)
merges r30894 from trunk into ruby_1_9_2.
-- * compile.c (get_exception_sym2type): guard temporary object from GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@31517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index 1f27174689..76dc76a161 100644
--- a/compile.c
+++ b/compile.c
@@ -5152,6 +5152,7 @@ get_exception_sym2type(VALUE sym)
{
#undef rb_intern
#define rb_intern(str) rb_intern_const(str)
+ VALUE sym_inspect;
static VALUE symRescue, symEnsure, symRetry;
static VALUE symBreak, symRedo, symNext;
@@ -5170,8 +5171,9 @@ get_exception_sym2type(VALUE sym)
if (sym == symBreak) return CATCH_TYPE_BREAK;
if (sym == symRedo) return CATCH_TYPE_REDO;
if (sym == symNext) return CATCH_TYPE_NEXT;
+ sym_inspect = rb_inspect(sym);
rb_raise(rb_eSyntaxError, "invalid exception symbol: %s",
- RSTRING_PTR(rb_inspect(sym)));
+ RSTRING_PTR(RB_GC_GUARD(sym_inspect)));
return 0;
}