This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] bug-regex12 testcase


Hi,

From: Jakub Jelinek <jakub@redhat.com>
Date: Sat, 28 Sep 2002 21:57:23 +0200

> Thanks. Unfortunately this patch breaks something else (attached
> bug-regex12.c). This is distilled from dc.sed as the first reg*exec
> call with different return value between sed's builtin regex and glibc
> regex.
> bug-regex12.c doesn't match (ie. succeeds) with glibc 2.2.5 and IMHO
> that's correct.

Well, I'm very sorry that I put the blame for my bugs on dc.sed.

The problems are caused by some optimistic checkings.
I introduce more checkings and a "fail stack" like NFA matcher.
(Fortunately, backtracking is rare in our matcher.)

With this patch, "make check" of sed-3.02 passed in my environment.
But there are one more problem, the evaluation of dc.sed is tooo slow.

The bottleneck is obviously the evaluations of back references
introduced by my last 2 patches.  I'll work on it in a hurry.

However, I'm afraid that I overlooked other problems again.
Then I send the patch in advance.
If you see more problems, would you please let me know?

2002-09-30  Isamu Hasegawa  <isamu@yamato.ibm.com>

	* posix/regex_internal.h (re_match_context_t): Add a new member.
	(re_fail_stack_ent_t): New structure.
	(re_fail_stack_t): Likewise.
	* posix/regexec.c (re_search_internal): Use the new member of
	re_match_context_t.
	Use fail stack only if it has back references and there are plural
	matching candidates.
	(proceed_next_node): Use fail stack if it is indicated.
	(set_regs): Likewise.
	(push_fail_stack): New function.
	(pop_fail_stack): New function.
	(check_dst_limits): Likewise.
	(check_dst_limits_calc_pos): Likewise.
	(search_subexp): Check the limitations on the top of subexpressions.
	(sift_states_bkref): Check the limitations of the destination node.
	Reuse the array sctx->sifted_states.

Thanks,
-- 
Isamu Hasegawa
IBM Japan, Ltd.

Attachment: patch.020930.gz
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]