mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Need to mark shared env objects as MRB_TT_FREE; fix #4143
The following code mistakenly exits from the function without marking
the env object as `MRB_TT_FREE`.
``` ruby
if (MRB_ENV_STACK_SHARED_P(e)) {
/* cannot be freed */
return; // <- should be `break`
}
```
This commit is contained in:
@@ -788,7 +788,8 @@ obj_free(mrb_state *mrb, struct RBasic *obj, int end)
|
|||||||
|
|
||||||
if (MRB_ENV_STACK_SHARED_P(e)) {
|
if (MRB_ENV_STACK_SHARED_P(e)) {
|
||||||
/* cannot be freed */
|
/* cannot be freed */
|
||||||
return;
|
e->stack = NULL;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
mrb_free(mrb, e->stack);
|
mrb_free(mrb, e->stack);
|
||||||
e->stack = NULL;
|
e->stack = NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user