diff --git a/ChangeLog b/ChangeLog index ad39501d2c..3ea3490517 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Dec 3 22:40:59 2008 Nobuyoshi Nakada + + * iseq.c (simple_default_value): returns simplest assignment only. + [ruby-core:20237] + Wed Dec 3 21:30:06 2008 Tanaka Akira * process.c (check_exec_redirect): accept :in, :out, :err as redirect diff --git a/iseq.c b/iseq.c index 54ae01f8c2..351ea41fd9 100644 --- a/iseq.c +++ b/iseq.c @@ -1292,13 +1292,12 @@ simple_default_value(const VALUE *seq, const VALUE *eseq) got: switch (*seq++) { case BIN(setlocal): - if ((seq+=1) != eseq) return Qundef; + if ((seq+=1) == eseq) return val; break; case BIN(setdynamic): - if ((seq+=2) != eseq) return Qundef; + if ((seq+=2) == eseq) return val; break; } - return val; default: return Qundef; }