Skip to content
Permalink
Browse files
Fixed a bug in dregex option generation; fix #3471
  • Loading branch information
matz committed Feb 28, 2017
1 parent 89eac4f commit c52bbe1b4e97d6580cced6c1b3819bd2e9289cc8
Showing 1 changed file with 11 additions and 4 deletions.
@@ -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);

0 comments on commit c52bbe1

Please sign in to comment.