diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-11-13 15:48:13 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-11-13 15:48:13 +0900 |
| commit | edd6c17c1e21e8ecc65241625fecb60e8deb4455 (patch) | |
| tree | b89a0c2cb710403be0365aaf3411422f11261f0c | |
| parent | 08e6bd47a02e2dbaf3d96f385caee102f95a26a1 (diff) | |
| download | mruby-edd6c17c1e21e8ecc65241625fecb60e8deb4455.tar.gz mruby-edd6c17c1e21e8ecc65241625fecb60e8deb4455.zip | |
load_exec() no longer return fixnum value for no_exec; should close #1569
| -rw-r--r-- | src/parse.y | 2 | ||||
| -rw-r--r-- | tools/mrbc/mrbc.c | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/parse.y b/src/parse.y index 8b4348a77..63204dfb0 100644 --- a/src/parse.y +++ b/src/parse.y @@ -5381,7 +5381,7 @@ load_exec(mrb_state *mrb, parser_state *p, mrbc_context *c) if (proc == NULL) { static const char msg[] = "codegen error"; mrb->exc = mrb_obj_ptr(mrb_exc_new(mrb, E_SCRIPT_ERROR, msg, sizeof(msg) - 1)); - return mrb_nil_value(); + return mrb_undef_value(); } if (c) { if (c->dump_result) codedump_all(mrb, proc); diff --git a/tools/mrbc/mrbc.c b/tools/mrbc/mrbc.c index 27e151ad2..46d0d95ca 100644 --- a/tools/mrbc/mrbc.c +++ b/tools/mrbc/mrbc.c @@ -212,11 +212,10 @@ load_file(mrb_state *mrb, struct mrbc_args *args) result = mrb_load_file_cxt(mrb, infile, c); if (need_close) fclose(infile); - if (mrb_undef_p(result) || mrb_fixnum(result) < 0) { - mrbc_context_free(mrb, c); + mrbc_context_free(mrb, c); + if (mrb_undef_p(result)) { return mrb_nil_value(); } - mrbc_context_free(mrb, c); return result; } |
