diff options
| author | yuri <[email protected]> | 2018-07-10 01:42:33 +0900 |
|---|---|---|
| committer | yuri <[email protected]> | 2018-07-10 01:42:33 +0900 |
| commit | dabb20ddbb51e6dac3bb6a8bac6dfcfd76808ac0 (patch) | |
| tree | 0c2ff85799ce7781324114dc58a6a52b9fe33b4a /src | |
| parent | 17c9e65603f3e21abc9f383532dbd33666245309 (diff) | |
| download | mruby-dabb20ddbb51e6dac3bb6a8bac6dfcfd76808ac0.tar.gz mruby-dabb20ddbb51e6dac3bb6a8bac6dfcfd76808ac0.zip | |
add mrbc option `--remove-lv`
* refactor: move `irep_remove_lv` from `mruby-bin-strip` gem to src/dump and rename to `mrb_irep_remove_lv`
* add: mrbc option `--remove-lv` to remove LVAR section
Diffstat (limited to 'src')
| -rw-r--r-- | src/dump.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/dump.c b/src/dump.c index df1e171e4..d0f0850fe 100644 --- a/src/dump.c +++ b/src/dump.c @@ -1103,4 +1103,19 @@ mrb_dump_irep_cfunc(mrb_state *mrb, mrb_irep *irep, uint8_t flags, FILE *fp, con return result; } +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]); + } +} + #endif /* MRB_DISABLE_STDIO */ |
