aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-16 07:18:45 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-16 07:18:45 +0000
commit0afc8db914227fd391b927e7517530361b2b3114 (patch)
tree00e2405de5149748c73fdf788f5dd96b2bd2ea65
parent026979e7cfb217136bb43c177cb1d065d61f0dc2 (diff)
downloadruby-0afc8db914227fd391b927e7517530361b2b3114.tar.gz
vm_insnhelper.c: cfp error at stack overflow
* vm_insnhelper.c (threadptr_stack_overflow): set stack overflow flag until handling execptions, to get rid of cfp consistency error when exec tag was rewound. [ruby-core:80618] [Bug #13412] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--vm.c1
-rw-r--r--vm_insnhelper.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/vm.c b/vm.c
index 0d942a9bfb..ea3cf6da3f 100644
--- a/vm.c
+++ b/vm.c
@@ -1808,6 +1808,7 @@ vm_exec(rb_thread_t *th)
const rb_control_frame_t *escape_cfp;
err = (struct vm_throw_data *)th->ec.errinfo;
+ rb_thread_raised_reset(th, RAISED_STACKOVERFLOW);
exception_handler:
cont_pc = cont_sp = 0;
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 69faf67fa6..303f9cc2fb 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -35,7 +35,7 @@ static void
threadptr_stack_overflow(rb_thread_t *th, int setup)
{
VALUE mesg = th->vm->special_exceptions[ruby_error_sysstack];
- th->ec.raised_flag = 0;
+ th->ec.raised_flag = RAISED_STACKOVERFLOW;
if (setup) {
VALUE at = rb_threadptr_backtrace_object(th);
mesg = ruby_vm_special_exception_copy(mesg);
@@ -1833,6 +1833,8 @@ vm_profile_show_result(void)
#define CHECK_CFP_CONSISTENCY(func) \
(LIKELY(reg_cfp == th->ec.cfp + 1) ? (void) 0 : \
+ rb_thread_raised_p(th, RAISED_STACKOVERFLOW) ? \
+ rb_thread_raised_reset(th, RAISED_STACKOVERFLOW) : \
rb_bug(func ": cfp consistency error (%p, %p)", reg_cfp, th->ec.cfp+1))
static inline