summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-compiler/core/parse.y
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-09-10 18:12:38 +0900
committerGitHub <[email protected]>2020-09-10 18:12:38 +0900
commitc27e45193177b6e4d09d526a248af63c0961035a (patch)
tree863c5082109295c880311b2abe1eefc4c748dc4d /mrbgems/mruby-compiler/core/parse.y
parentc345fe432171cc2b90b614a0b44305b218090de6 (diff)
parent9840e5352b2abf96235068f0e9d08f14b1d333cf (diff)
downloadmruby-c27e45193177b6e4d09d526a248af63c0961035a.tar.gz
mruby-c27e45193177b6e4d09d526a248af63c0961035a.zip
Merge pull request #4933 from dearblue/variables
Fix take over file scope variables with `mruby` and `mirb` command
Diffstat (limited to 'mrbgems/mruby-compiler/core/parse.y')
-rw-r--r--mrbgems/mruby-compiler/core/parse.y10
1 files changed, 10 insertions, 0 deletions
diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y
index 3ae2022cf..9de45a536 100644
--- a/mrbgems/mruby-compiler/core/parse.y
+++ b/mrbgems/mruby-compiler/core/parse.y
@@ -6377,6 +6377,16 @@ mrbc_partial_hook(mrb_state *mrb, mrbc_context *c, int (*func)(struct mrb_parser
}
MRB_API void
+mrbc_cleanup_local_variables(mrb_state *mrb, mrbc_context *c)
+{
+ if (c->syms) {
+ mrb_free(mrb, c->syms);
+ c->syms = NULL;
+ c->slen = 0;
+ }
+}
+
+MRB_API void
mrb_parser_set_filename(struct mrb_parser_state *p, const char *f)
{
mrb_sym sym;