diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-24 07:17:44 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-24 07:17:44 +0000 |
commit | a12fb26ff7218d66a5062bc97d1fad6c34678ef6 (patch) | |
tree | 35acc7d17f55a4e1a742e2803f2026cf1751debf /string.c | |
parent | 8b0cfe9042aa04a8f574fe4169ecea43b550b638 (diff) | |
download | ruby-a12fb26ff7218d66a5062bc97d1fad6c34678ef6.tar.gz |
string.c (rb_str_justify): use RB_GC_GUARD
See doc/extension.rdoc for justification using RB_GC_GUARD instead
of volatile.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -7908,7 +7908,7 @@ rb_str_justify(int argc, VALUE *argv, VALUE str, char jflag) char *p; const char *f = " "; long n, size, llen, rlen, llen2 = 0, rlen2 = 0; - volatile VALUE pad; + VALUE pad; int singlebyte = 1, cr; rb_scan_args(argc, argv, "11", &w, &pad); @@ -7985,6 +7985,8 @@ rb_str_justify(int argc, VALUE *argv, VALUE str, char jflag) cr = ENC_CODERANGE_AND(cr, ENC_CODERANGE(pad)); if (cr != ENC_CODERANGE_BROKEN) ENC_CODERANGE_SET(res, cr); + + RB_GC_GUARD(pad); return res; } |