1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* eval.c (rb_eval): NODE_XSTR should pass copy of literal string.

* array.c (rb_ary_update): a[n,m]=nil no longer works as element
  deletion.

* enum.c (enum_sort_by): protect continuation jump in.
  [ruby-dev:24642]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2004-10-30 06:56:18 +00:00
parent ad2c05f1c0
commit 3e9e2bd4ed
17 changed files with 120 additions and 93 deletions

View file

@ -684,7 +684,16 @@ compile_range_repeat_node(QualifierNode* qn, int target_len, int empty_info,
r = compile_tree_empty_check(qn->target, reg, empty_info);
if (r) return r;
r = add_opcode(reg, qn->greedy ? OP_REPEAT_INC : OP_REPEAT_INC_NG);
if (
#ifdef USE_SUBEXP_CALL
reg->num_call > 0 ||
#endif
IS_QUALIFIER_IN_REPEAT(qn)) {
r = add_opcode(reg, qn->greedy ? OP_REPEAT_INC_SG : OP_REPEAT_INC_NG_SG);
}
else {
r = add_opcode(reg, qn->greedy ? OP_REPEAT_INC : OP_REPEAT_INC_NG);
}
if (r) return r;
r = add_mem_num(reg, num_repeat); /* OP_REPEAT ID */
return r;
@ -3057,6 +3066,10 @@ setup_tree(Node* node, regex_t* reg, int state, ScanEnv* env)
QualifierNode* qn = &(NQUALIFIER(node));
Node* target = qn->target;
if ((state & IN_REPEAT) != 0) {
qn->state |= NST_IN_REPEAT;
}
if (IS_REPEAT_INFINITE(qn->upper) || qn->upper >= 1) {
r = get_min_match_length(target, &d, env);
if (r) break;