summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-11 02:01:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-11 02:01:36 +0000
commite5c516c89a62839fd025ae112041ed9a5f06c9d0 (patch)
tree5457f6e76dcfa0d9f0dd2f84ad68036fb6c297ab /ext
parent4068d9089adca488546c7ff8b59118eb47a3ade0 (diff)
generator.c: fix infinite recursion
* ext/json/generator/generator.c (generate_json): get rid of unnecessary recursive calls which can cause infinite recursion. T_STRING may not have rb_cString. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/json/generator/generator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/json/generator/generator.c b/ext/json/generator/generator.c
index 7805cde..9641ecb 100644
--- a/ext/json/generator/generator.c
+++ b/ext/json/generator/generator.c
@@ -880,7 +880,7 @@ static void generate_json(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *s
} else {
tmp = rb_funcall(obj, i_to_s, 0);
Check_Type(tmp, T_STRING);
- generate_json(buffer, Vstate, state, tmp);
+ generate_json_string(buffer, Vstate, state, tmp);
}
}