Unverified Commit 3a95bf0d authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4272 from shuujii/refactor-for-node_back_ref-in-codegen

Small refactoring in `codegen.c`
parents ef93ff64 c6e2d915
...@@ -2357,13 +2357,9 @@ codegen(codegen_scope *s, node *tree, int val) ...@@ -2357,13 +2357,9 @@ codegen(codegen_scope *s, node *tree, int val)
case NODE_BACK_REF: case NODE_BACK_REF:
if (val) { if (val) {
char buf[3]; char buf[] = {'$', nchar(tree)};
int sym; int sym = new_sym(s, mrb_intern(s->mrb, buf, sizeof(buf)));
buf[0] = '$';
buf[1] = nchar(tree);
buf[2] = 0;
sym = new_sym(s, mrb_intern_cstr(s->mrb, buf));
genop_2(s, OP_GETGV, cursp(), sym); genop_2(s, OP_GETGV, cursp(), sym);
push(); push();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment