Merge remote-tracking branch 'upstream/master' into mrbgems

This commit is contained in:
Daniel Bovensiepen
2012-11-09 13:16:50 +09:00
4 changed files with 5 additions and 3 deletions
+1
View File
@@ -2097,6 +2097,7 @@ scope_finish(codegen_scope *s, int idx)
mrb_add_irep(mrb, idx);
irep = mrb->irep[idx] = (mrb_irep *)mrb_malloc(mrb, sizeof(mrb_irep));
irep->flags = 0;
irep->idx = idx;
if (s->iseq) {
irep->iseq = (mrb_code *)codegen_realloc(s, s->iseq, sizeof(mrb_code)*s->pc);
+1 -1
View File
@@ -325,7 +325,7 @@ struct RBasic*
mrb_obj_alloc(mrb_state *mrb, enum mrb_vtype ttype, struct RClass *cls)
{
struct RBasic *p;
static const RVALUE RVALUE_zero = { { { 0 } } };
static const RVALUE RVALUE_zero = { { { MRB_TT_FALSE } } };
#ifdef MRB_GC_STRESS
mrb_garbage_collect(mrb);
+1 -1
View File
@@ -53,7 +53,7 @@ mrb_alloca(mrb_state *mrb, size_t size)
{
struct alloca_header *p;
p = mrb_malloc(mrb, sizeof(struct alloca_header)+size);
p = (struct alloca_header*) mrb_malloc(mrb, sizeof(struct alloca_header)+size);
p->next = mrb->mems;
mrb->mems = p;
return (void*)p->buf;
+2 -1
View File
@@ -939,6 +939,7 @@ mrb_str_chomp_bang(mrb_state *mrb, mrb_value str)
else {
return mrb_nil_value();
}
s->ptr[s->len] = '\0';
return str;
}
@@ -970,7 +971,7 @@ mrb_str_chomp_bang(mrb_state *mrb, mrb_value str)
(rslen <= 1 ||
memcmp(RSTRING_PTR(rs), pp, rslen) == 0)) {
s->len = len - rslen;
p[len] = '\0';
p[s->len] = '\0';
return str;
}
return mrb_nil_value();