From: Yukihiro Matsumoto Date: 2006-12-03T00:59:51+09:00 Subject: Re: Segmentation fault, proc, eval, long string [Reproduced] Hi, In message "Re: Segmentation fault, proc, eval, long string [Reproduced]" on Fri, 1 Dec 2006 02:50:30 +0900, Bob Hutchison writes: |There is nothing that is anywhere that deep in the script that I am |evaluating. So it looks as though the proc object is corrupt?? | |So maybe this is reproducible?? Well, so it is. If I run this script: Thank you for the report. Your script helped. Could you check if the attached patch work for you? matz. Index: parse.y =================================================================== RCS file: /var/cvs/src/ruby/parse.y,v retrieving revision 1.307.2.47 diff -p -u -1 -r1.307.2.47 parse.y --- parse.y 2 Nov 2006 06:45:50 -0000 1.307.2.47 +++ parse.y 2 Dec 2006 15:57:23 -0000 @@ -4863,2 +4863,4 @@ gettable(id) +static VALUE dyna_var_lookup _((ID id)); + static NODE* @@ -4891,3 +4893,3 @@ assignable(id, val) } - else if (rb_dvar_defined(id)) { + else if (dyna_var_lookup(id)) { return NEW_DASGN(id, val); @@ -5733,2 +5735,18 @@ top_local_setup() +static VALUE +dyna_var_lookup(id) + ID id; +{ + struct RVarmap *vars = ruby_dyna_vars; + + while (vars) { + if (vars->id == id) { + vars->val = Qtrue; + return Qtrue; + } + vars = vars->next; + } + return Qfalse; +} + static struct RVarmap* @@ -5767,3 +5786,5 @@ dyna_init(node, pre) for (var = 0; post != pre && post->id; post = post->next) { - var = NEW_DASGN_CURR(post->id, var); + if (RTEST(post->val)) { + var = NEW_DASGN_CURR(post->id, var); + } }