diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-02 08:33:30 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-02 08:33:30 +0000 |
commit | 896e7f2d8dd7fa190c4514043b3aa5fcfa20c65f (patch) | |
tree | a9fc4fb6d026f8139e48adeedb56798d8839e119 /compile.c | |
parent | f5740d18bfc2c16c8996dcba9d15303f9404b406 (diff) | |
download | ruby-896e7f2d8dd7fa190c4514043b3aa5fcfa20c65f.tar.gz |
compile.c: fix stack consitency error
* compile.c (iseq_compile_each0): fix stack consitency error on
attr-assign with safe navigation operator when the receiver is
nil, should pop it too. [ruby-core:83078] [Bug #13964]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -5415,8 +5415,11 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int popp ADD_INSN1(ret, line, topn, INT2FIX(1)); } ADD_SEND_WITH_FLAG(ret, line, aid, INT2FIX(1), INT2FIX(asgnflag)); + if (lskip && popped) { + ADD_LABEL(ret, lskip); + } ADD_INSN(ret, line, pop); - if (lskip) { + if (lskip && !popped) { ADD_LABEL(ret, lskip); } } |