diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/codegen.c | 1 | ||||
| -rw-r--r-- | src/string.c | 2 | ||||
| -rw-r--r-- | src/vm.c | 5 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/codegen.c b/src/codegen.c index 418e1f371..c869285d9 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -719,6 +719,7 @@ attrsym(codegen_scope *s, mrb_sym a) + 1 /* '=' */ + 1 /* '\0' */ ); + mrb_assert(len <= SIZE_MAX); memcpy(name2, name, (size_t)len); name2[len] = '='; name2[len+1] = '\0'; diff --git a/src/string.c b/src/string.c index 439cb5409..e5aac98b7 100644 --- a/src/string.c +++ b/src/string.c @@ -754,7 +754,7 @@ mrb_memsearch(const void *x0, mrb_int m, const void *y0, mrb_int n) else if (m < 1) { return 0; } - else if (m == 1) { + else if (m == 1) { const unsigned char *ys = y, *ye = ys + n; for (; y < ye; ++y) { if (*x == *y) @@ -460,7 +460,6 @@ mrb_f_send(mrb_state *mrb, mrb_value self) ci->mid = name; ci->target_class = c; ci->proc = p; - ci->nregs = p->body.irep->nregs; regs = mrb->c->stack+1; /* remove first symbol from arguments */ if (ci->argc >= 0) { @@ -477,8 +476,8 @@ mrb_f_send(mrb_state *mrb, mrb_value self) return p->body.func(mrb, self); } - cipush(mrb); - ci = mrb->c->ci; + ci->nregs = p->body.irep->nregs; + ci = cipush(mrb); ci->target_class = 0; ci->pc = p->body.irep->iseq; ci->stackent = mrb->c->stack; |
