Skip to content

Fixes local variables in mruby-binding.#6281

Merged
matz merged 1 commit intomruby:masterfrom
dearblue:binding
May 31, 2024
Merged

Fixes local variables in mruby-binding.#6281
matz merged 1 commit intomruby:masterfrom
dearblue:binding

Conversation

@dearblue
Copy link
Copy Markdown
Contributor

There are two issues to be fixed:

  • mrb_irep could leak if mrb_calloc() encountered an out-of-memory exception
  • mrb_proc_merge_lvar() allocated one extra variable name.

irep->lv can always refer to only one less range than irep->nlocals. Also, when mrb_proc_merge_lvar() extends irep->lv, mrb_realloc() with NULL has the same behavior as mrb_malloc().

There are two issues to be fixed:
  - `mrb_irep` could leak if `mrb_calloc()` encountered an out-of-memory exception
  - `mrb_proc_merge_lvar()` allocated one extra variable name.

`irep->lv` can always refer to only one less range than `irep->nlocals`.
Also, when `mrb_proc_merge_lvar()` extends `irep->lv`, `mrb_realloc()` with `NULL` has the same behavior as `mrb_malloc()`.
@dearblue dearblue requested a review from matz as a code owner May 30, 2024 12:53
@matz matz merged commit 00a874c into mruby:master May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants