From 0899bd522778b06ac2964b95e469d8e9c7ef6692 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 29 Mar 2015 04:49:57 +0000 Subject: [PATCH] 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 --- proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proc.c b/proc.c index 0e965ff9e1..db79870b2d 100644 --- a/proc.c +++ b/proc.c @@ -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);