transcode.c: add GC guard on raise
* transcode.c (econv_s_search_convpath): add GC guard to fix SEGV on raise. [Bug #15162] [ruby-core:89172] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4add701ad4
commit
b965781e8f
@ -3155,8 +3155,12 @@ econv_s_search_convpath(int argc, VALUE *argv, VALUE klass)
|
|||||||
convpath = Qnil;
|
convpath = Qnil;
|
||||||
transcode_search_path(sname, dname, search_convpath_i, &convpath);
|
transcode_search_path(sname, dname, search_convpath_i, &convpath);
|
||||||
|
|
||||||
if (NIL_P(convpath))
|
if (NIL_P(convpath)) {
|
||||||
rb_exc_raise(rb_econv_open_exc(sname, dname, ecflags));
|
VALUE exc = rb_econv_open_exc(sname, dname, ecflags);
|
||||||
|
RB_GC_GUARD(snamev);
|
||||||
|
RB_GC_GUARD(dnamev);
|
||||||
|
rb_exc_raise(exc);
|
||||||
|
}
|
||||||
|
|
||||||
if (decorate_convpath(convpath, ecflags) == -1) {
|
if (decorate_convpath(convpath, ecflags) == -1) {
|
||||||
VALUE exc = rb_econv_open_exc(sname, dname, ecflags);
|
VALUE exc = rb_econv_open_exc(sname, dname, ecflags);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user