diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-04-01 14:13:06 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-04-01 14:13:06 +0900 |
| commit | 2871d0cdc5e5ef952d27187b5488888bbd18c5b0 (patch) | |
| tree | 8167e5b1914548d62bcb14ac32b0f1411fe39172 /mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c | |
| parent | 6ec855a38e8116e4f0d04f188e948046b47af74f (diff) | |
| download | mruby-2871d0cdc5e5ef952d27187b5488888bbd18c5b0.tar.gz mruby-2871d0cdc5e5ef952d27187b5488888bbd18c5b0.zip | |
Avoid keeping pointers from `mrb_sym2name_len()`; fix #4342
The addresses for packed inline symbols reference `mrb->symbuf` that
could be overridden by the later call of `mrb_sym2name_len`. Since
file names in call stack information are kept as symbols, keeping the
address in the C structures could cause problems like #4342.
This changes small incompatible changes in function prototypes:
* `mrb_parser_get_filename`: return value changed to `mrb_sym`.
* `mrb_debug_get_filename`: add `mrb_state*` as a first argument.
* `mrb_debug_get_line`: ditto.
I believe above functions are almost internal, and no third-party
mrbgem use them.
Diffstat (limited to 'mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c')
| -rw-r--r-- | mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c b/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c index 5256ac5e3..003406172 100644 --- a/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c +++ b/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c @@ -569,8 +569,8 @@ mrb_code_fetch_hook(mrb_state *mrb, mrb_irep *irep, mrb_code *pc, mrb_value *reg dbg->xphase = DBG_PHASE_RUNNING; } - file = mrb_debug_get_filename(irep, pc - irep->iseq); - line = mrb_debug_get_line(irep, pc - irep->iseq); + file = mrb_debug_get_filename(mrb, irep, pc - irep->iseq); + line = mrb_debug_get_line(mrb, irep, pc - irep->iseq); switch (dbg->xm) { case DBG_STEP: |
