summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-04-01 14:13:06 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2019-04-01 14:13:06 +0900
commit2871d0cdc5e5ef952d27187b5488888bbd18c5b0 (patch)
tree8167e5b1914548d62bcb14ac32b0f1411fe39172 /mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c
parent6ec855a38e8116e4f0d04f188e948046b47af74f (diff)
downloadmruby-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/apilist.c')
-rw-r--r--mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c b/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c
index 21fe64127..66ddfa783 100644
--- a/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c
+++ b/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c
@@ -181,7 +181,7 @@ mrb_debug_get_source(mrb_state *mrb, mrdb_state *mrdb, const char *srcpath, cons
else srcname = filename;
search_path[0] = srcpath;
- search_path[1] = dirname(mrb, mrb_debug_get_filename(mrdb->dbg->irep, 0));
+ search_path[1] = dirname(mrb, mrb_debug_get_filename(mrb, mrdb->dbg->irep, 0));
search_path[2] = ".";
for (i = 0; i < 3; i++) {