diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-04-20 00:47:19 -0700 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-04-20 00:47:19 -0700 |
| commit | ce195a4465974228dae57b8b836941fa9054ff0b (patch) | |
| tree | bac64465b5c6d13dbeafa8a8a7bd709755410066 | |
| parent | cb0badf65061c2bb49d18ea6bd3a17f3659e4b8c (diff) | |
| parent | b831887a253724bcaeb0bcc7976fb456ace7a29f (diff) | |
| download | mruby-ce195a4465974228dae57b8b836941fa9054ff0b.tar.gz mruby-ce195a4465974228dae57b8b836941fa9054ff0b.zip | |
Merge pull request #2 from fceller/master
Fix for Linux
| -rw-r--r-- | src/error.c | 2 | ||||
| -rw-r--r-- | src/load.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/error.c b/src/error.c index 9dbfc972f..a671c6bbd 100644 --- a/src/error.c +++ b/src/error.c @@ -199,8 +199,8 @@ mrb_raise(mrb_state *mrb, struct RClass *c, const char *fmt, ...) va_start(args, fmt); vsnprintf(buf, 256, fmt, args); - mrb_raise_va(mrb, c, fmt, args); va_end(args); + mrb_exc_raise(mrb, mrb_exc_new(mrb, c, buf, strlen(buf))); } void diff --git a/src/load.c b/src/load.c index 848cf8f9a..3f5dc2c57 100644 --- a/src/load.c +++ b/src/load.c @@ -444,7 +444,7 @@ read_rite_irep_record(mrb_state *mrb, unsigned char *src, mrb_irep *irep, uint32 irep->slen = bin_to_uint32(src); //syms length src += MRB_DUMP_SIZE_OF_LONG; if (irep->slen > 0) { - if ((irep->syms = mrb_malloc(mrb, MRB_DUMP_SIZE_OF_INT * irep->slen)) == NULL) { + if ((irep->syms = mrb_malloc(mrb, sizeof(mrb_sym) * irep->slen)) == NULL) { ret = MRB_DUMP_INVALID_IREP; goto error_exit; } |
