1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

proc.c: check iseq before replication

* proc.c (proc_binding): do not replicate when iseq not found as
  rb_method_get_iseq() can return NULL.
  [ruby-core:68673] [Bug #11012]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-03-29 04:49:57 +00:00
parent 509089e9b1
commit 0899bd5227

2
proc.c
View file

@ -2507,7 +2507,7 @@ proc_binding(VALUE self)
}
iseq = rb_method_get_iseq((VALUE)((struct vm_ifunc *)iseq)->data);
GetEnvPtr(envval, env);
if (env->local_size < iseq->local_size) {
if (iseq && env->local_size < iseq->local_size) {
int prev_local_size = env->local_size;
int local_size = iseq->local_size;
VALUE newenvval = TypedData_Wrap_Struct(RBASIC_CLASS(envval), RTYPEDDATA_TYPE(envval), 0);