diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-10-18 11:26:30 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-10-18 11:26:30 +0900 |
| commit | 3f06307317ceb4bef2f4c245205d389d23456397 (patch) | |
| tree | 81945f2b56f89c2384edf68d3be8d172bf2b08da /mrbgems/mruby-eval | |
| parent | 3ff5081650cd510186a1e0105641dd10e8b4e7c8 (diff) | |
| download | mruby-3f06307317ceb4bef2f4c245205d389d23456397.tar.gz mruby-3f06307317ceb4bef2f4c245205d389d23456397.zip | |
need addtional type check to avoid SEGV; ref #2609
Diffstat (limited to 'mrbgems/mruby-eval')
| -rw-r--r-- | mrbgems/mruby-eval/src/eval.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mrbgems/mruby-eval/src/eval.c b/mrbgems/mruby-eval/src/eval.c index e97e580fa..7b83eb624 100644 --- a/mrbgems/mruby-eval/src/eval.c +++ b/mrbgems/mruby-eval/src/eval.c @@ -12,7 +12,11 @@ get_closure_irep(mrb_state *mrb, int level) struct RProc *proc; if (level == 0) { - return mrb->c->ci[-1].proc->body.irep; + proc = mrb->c->ci[-1].proc; + if (MRB_PROC_CFUNC_P(proc)) { + return NULL; + } + return proc->body.irep; } while (--level) { |
