Skip to content
  • Yukihiro "Matz" Matsumoto's avatar
    2871d0cd
    Avoid keeping pointers from `mrb_sym2name_len()`; fix #4342 · 2871d0cd
    Yukihiro "Matz" Matsumoto authored
    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.
    2871d0cd
    Avoid keeping pointers from `mrb_sym2name_len()`; fix #4342
    Yukihiro "Matz" Matsumoto authored
    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.
Loading