From f323e9d232b9e0e425b16edf1f57569e65b0f888 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Wed, 24 Jun 2015 16:02:46 +0900 Subject: [PATCH] [bugfix] call/cc will get caught in an infinite loop if the machine stack grows upward --- contrib/10.callcc/callcc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/10.callcc/callcc.c b/contrib/10.callcc/callcc.c index 22287fea..2e2561fe 100644 --- a/contrib/10.callcc/callcc.c +++ b/contrib/10.callcc/callcc.c @@ -178,7 +178,7 @@ restore_cont(pic_state *pic, struct pic_fullcont *cont) if (&v > cont->stk_pos) native_stack_extend(pic, cont); } else { - if (&v > cont->stk_pos + cont->stk_len) native_stack_extend(pic, cont); + if (&v < cont->stk_pos + cont->stk_len) native_stack_extend(pic, cont); } pic->cc = cont->prev_jmp;