diff options
| author | yuri <[email protected]> | 2018-07-10 15:44:25 +0900 |
|---|---|---|
| committer | yuri <[email protected]> | 2018-07-10 15:44:25 +0900 |
| commit | 5fef38e4c77cb3700750fe0020063289a49242d6 (patch) | |
| tree | 82cd2bfb73c29e09f59227fd0a54320e7d1e8c32 /mrbgems/mruby-compiler/core/codegen.c | |
| parent | dabb20ddbb51e6dac3bb6a8bac6dfcfd76808ac0 (diff) | |
| download | mruby-5fef38e4c77cb3700750fe0020063289a49242d6.tar.gz mruby-5fef38e4c77cb3700750fe0020063289a49242d6.zip | |
move mrb_irep_remove_lv to codegen.c in mruby-compiler
Diffstat (limited to 'mrbgems/mruby-compiler/core/codegen.c')
| -rw-r--r-- | mrbgems/mruby-compiler/core/codegen.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c index f71de9b4b..fec747f0c 100644 --- a/mrbgems/mruby-compiler/core/codegen.c +++ b/mrbgems/mruby-compiler/core/codegen.c @@ -3092,3 +3092,18 @@ mrb_generate_code(mrb_state *mrb, parser_state *p) { return generate_code(mrb, p, VAL); } + +void +mrb_irep_remove_lv(mrb_state *mrb, mrb_irep *irep) +{ + int i; + + if (irep->lv) { + mrb_free(mrb, irep->lv); + irep->lv = NULL; + } + + for (i = 0; i < irep->rlen; ++i) { + mrb_irep_remove_lv(mrb, irep->reps[i]); + } +} |
