aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--insnhelper.ci3
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index bbfddcb04a..aa18e2aa50 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Aug 18 15:45:34 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * insnhelper.ci (vm_yield_setup_args): rsize and psize should not be
+ negative.
+
Sat Aug 18 14:35:00 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* insnhelper.ci (vm_callee_setup_arg, vm_send_optimize,
diff --git a/insnhelper.ci b/insnhelper.ci
index ff42a7c2fa..369aeef251 100644
--- a/insnhelper.ci
+++ b/insnhelper.ci
@@ -715,11 +715,10 @@ vm_yield_setup_args(rb_thread_t *th, rb_iseq_t *iseq,
if (iseq->arg_post_len) {
int len = iseq->arg_post_len;
int start = iseq->arg_post_start;
- int rsize = argc - m;
+ int rsize = argc > m ? argc - m : 0;
int psize = rsize;
VALUE ary;
- if (rsize < 0) rsize = 0;
if (psize > len) psize = len;
ary = rb_ary_new4(rsize - psize, &argv[r]);