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

check before access.

* vm_insnhelper.c (vm_push_frame): validate prev_frame because
  prev_frame can be the end of frame.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2018-10-19 05:26:35 +00:00
parent 00c9a6188b
commit 2d4a268cd3

View file

@ -271,9 +271,10 @@ vm_push_frame(rb_execution_context_t *ec,
}
{
rb_control_frame_t *prev_cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
int cur_ruby_frame = VM_FRAME_RUBYFRAME_P(cfp);
int pre_ruby_frame = VM_FRAME_RUBYFRAME_P(prev_cfp);
if (RUBY_VM_END_CONTROL_FRAME(ec) != prev_cfp) {
int cur_ruby_frame = VM_FRAME_RUBYFRAME_P(cfp);
int pre_ruby_frame = VM_FRAME_RUBYFRAME_P(prev_cfp);
pre_ruby_frame ? (cur_ruby_frame ? RB_DEBUG_COUNTER_INC(frame_R2R) :
RB_DEBUG_COUNTER_INC(frame_R2C)):
(cur_ruby_frame ? RB_DEBUG_COUNTER_INC(frame_C2R) :