comparison src/regex.c @ 1024:ccaf90c5a53a

[xemacs-hg @ 2002-10-02 09:29:37 by stephent] 21.4 -> R21.5 stuff manual improvements <87k7l1p6su.fsf@tleepslib.sk.tsukuba.ac.jp> regexp tests <87fzvpp6mf.fsf@tleepslib.sk.tsukuba.ac.jp> add-to-list doc Ville Skyttä <87bs6dp6io.fsf@tleepslib.sk.tsukuba.ac.jp> Move filename associations Ville Skyttä <877kh1p6ee.fsf@tleepslib.sk.tsukuba.ac.jp> lookup-syntax-properties <87admil2e0.fsf_-_@tleepslib.sk.tsukuba.ac.jp> fix stale submatches <873crpp50v.fsf_-_@tleepslib.sk.tsukuba.ac.jp> info for developers <87y99hnqc4.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Wed, 02 Oct 2002 09:31:40 +0000
parents 804517e16990
children b03923afd851
comparison
equal deleted inserted replaced
1023:ce9bdd48654f 1024:ccaf90c5a53a
4914 (regoff_t) POINTER_TO_OFFSET (regstart[internal_reg]); 4914 (regoff_t) POINTER_TO_OFFSET (regstart[internal_reg]);
4915 regs->end[mcnt] = 4915 regs->end[mcnt] =
4916 (regoff_t) POINTER_TO_OFFSET (regend[internal_reg]); 4916 (regoff_t) POINTER_TO_OFFSET (regend[internal_reg]);
4917 } 4917 }
4918 } 4918 }
4919
4920 /* If the regs structure we return has more elements than
4921 were in the pattern, set the extra elements to -1. If
4922 we (re)allocated the registers, this is the case,
4923 because we always allocate enough to have at least one
4924 -1 at the end. */
4925 for (mcnt = num_nonshy_regs; mcnt < regs->num_regs; mcnt++)
4926 regs->start[mcnt] = regs->end[mcnt] = -1;
4927 } /* regs && !bufp->no_sub */ 4919 } /* regs && !bufp->no_sub */
4920
4921 /* If we have regs and the regs structure has more elements than
4922 were in the pattern, set the extra elements to -1. If we
4923 (re)allocated the registers, this is the case, because we
4924 always allocate enough to have at least one -1 at the end.
4925
4926 We do this even when no_sub is set because some applications
4927 (XEmacs) reuse register structures which may contain stale
4928 information, and permit attempts to access those registers.
4929
4930 It would be possible to require the caller to do this, but we'd
4931 have to change the API for this function to reflect that, and
4932 audit all callers. */
4933 if (regs && regs->num_regs > 0)
4934 for (mcnt = num_nonshy_regs; mcnt < regs->num_regs; mcnt++)
4935 regs->start[mcnt] = regs->end[mcnt] = -1;
4928 4936
4929 DEBUG_PRINT4 ("%u failure points pushed, %u popped (%u remain).\n", 4937 DEBUG_PRINT4 ("%u failure points pushed, %u popped (%u remain).\n",
4930 nfailure_points_pushed, nfailure_points_popped, 4938 nfailure_points_pushed, nfailure_points_popped,
4931 nfailure_points_pushed - nfailure_points_popped); 4939 nfailure_points_pushed - nfailure_points_popped);
4932 DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed); 4940 DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed);