diff options
| author | Tatsuhiko Kubo <[email protected]> | 2014-08-20 05:48:09 +0900 |
|---|---|---|
| committer | Tatsuhiko Kubo <[email protected]> | 2014-08-20 05:48:09 +0900 |
| commit | effc44f265c19d25545e01b94831631c3a5bef5f (patch) | |
| tree | 6bd1025c303e8016477caa75e74f54e57572c121 /tasks | |
| parent | d49f8517a6d2350eb1ed2642749f3994a9a2d056 (diff) | |
| download | mruby-effc44f265c19d25545e01b94831631c3a5bef5f.tar.gz mruby-effc44f265c19d25545e01b94831631c3a5bef5f.zip | |
Fix error handlings for mrb_open_core().
Diffstat (limited to 'tasks')
| -rw-r--r-- | tasks/mrbgem_spec.rake | 1 | ||||
| -rw-r--r-- | tasks/mrbgems_test.rake | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/tasks/mrbgem_spec.rake b/tasks/mrbgem_spec.rake index 1d97e2bbf..95e1c5f02 100644 --- a/tasks/mrbgem_spec.rake +++ b/tasks/mrbgem_spec.rake @@ -183,6 +183,7 @@ module MRuby def print_gem_test_header(f) print_gem_comment(f) + f.puts %Q[#include <stdio.h>] f.puts %Q[#include <stdlib.h>] f.puts %Q[#include "mruby.h"] f.puts %Q[#include "mruby/irep.h"] diff --git a/tasks/mrbgems_test.rake b/tasks/mrbgems_test.rake index f3496dc8d..016379197 100644 --- a/tasks/mrbgems_test.rake +++ b/tasks/mrbgems_test.rake @@ -47,6 +47,10 @@ MRuby.each_target do g.test_rbfiles.count.times do |i| f.puts %Q[ ai = mrb_gc_arena_save(mrb);] f.puts %Q[ mrb2 = mrb_open_core(mrb_default_allocf, NULL);] + f.puts %Q[ if (mrb2 == NULL) {] + f.puts %Q[ fprintf(stderr, "Invalid mrb_state, exiting \%s", __FUNCTION__);] + f.puts %Q[ exit(EXIT_FAILURE);] + f.puts %Q[ }] dep_list.each do |d| f.puts %Q[ GENERATED_TMP_mrb_#{d.funcname}_gem_init(mrb2);] f.puts %Q[ mrb_state_atexit(mrb2, GENERATED_TMP_mrb_#{d.funcname}_gem_final);] |
