Skip to content

Commit

Permalink
Fixed a bug in dregex option generation; fix #3471
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Feb 28, 2017
1 parent 89eac4f commit c52bbe1
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions mrbgems/mruby-compiler/core/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -2473,16 +2473,23 @@ codegen(codegen_scope *s, node *tree, int val)
pop();
genop_peep(s, MKOP_AB(OP_STRCAT, cursp(), cursp()+1), VAL);
}
if (n->cdr) {
char *p2 = (char*)n->cdr;
if (n->cdr->car) {
char *p2 = (char*)n->cdr->car;

push();
off = new_lit(s, mrb_str_new_cstr(s->mrb, p2));
genop(s, MKOP_ABx(OP_STRING, cursp(), off));
argc++;
pop();
}
pop();
if (n->cdr->cdr) {
char *p2 = (char*)n->cdr->cdr;

push();
off = new_lit(s, mrb_str_new_cstr(s->mrb, p2));
genop(s, MKOP_ABx(OP_STRING, cursp(), off));
argc++;
}
pop_n(argc);
sym = new_sym(s, mrb_intern_lit(s->mrb, "compile"));
genop(s, MKOP_ABC(OP_SEND, cursp(), sym, argc));
mrb_gc_arena_restore(s->mrb, ai);
Expand Down

0 comments on commit c52bbe1

Please sign in to comment.