diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-07-24 16:47:11 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-07-24 16:47:11 +0900 |
| commit | 308341b990dd382f999d8ad2382e4ce92453a8c9 (patch) | |
| tree | fe5ffebc1ebddd4ad6e604ed7073b2c6e7a83d46 | |
| parent | 1fc9a3019d586a04a82bde86a7c443673f94cd7c (diff) | |
| download | mruby-308341b990dd382f999d8ad2382e4ce92453a8c9.tar.gz mruby-308341b990dd382f999d8ad2382e4ce92453a8c9.zip | |
Clear mrb_callinfo struct by zero initializer.
| -rw-r--r-- | src/vm.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -253,6 +253,7 @@ static inline mrb_callinfo* cipush(mrb_state *mrb) { struct mrb_context *c = mrb->c; + static const mrb_callinfo ci_zero = { 0 }; mrb_callinfo *ci = c->ci; int ridx = ci->ridx; @@ -265,13 +266,9 @@ cipush(mrb_state *mrb) c->ciend = c->cibase + size * 2; } ci = ++c->ci; + *ci = ci_zero; ci->epos = mrb->c->eidx; ci->ridx = ridx; - ci->env = 0; - ci->pc = 0; - ci->err = 0; - ci->proc = 0; - ci->acc = 0; return ci; } |
