[前][次][番号順一覧][スレッド一覧]

ruby-changes:4989

From: ko1@a...
Date: Mon, 19 May 2008 23:21:35 +0900 (JST)
Subject: [ruby-changes:4989] mame - Ruby:r16482 (trunk): * regexec.c (slow_search): check the case when the length is 1.

mame	2008-05-19 23:21:15 +0900 (Mon, 19 May 2008)

  New Revision: 16482

  Modified files:
    trunk/ChangeLog
    trunk/regexec.c

  Log:
    * regexec.c (slow_search): check the case when the length is 1.
      The behavior of memcmp is undefined if the third argument is 0.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/regexec.c?r1=16482&r2=16481&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=16482&r2=16481&diff_format=u

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 16481)
+++ ChangeLog	(revision 16482)
@@ -1,3 +1,8 @@
+Mon May 19 23:19:35 2008  Yusuke Endoh  <mame@t...>
+
+	* regexec.c (slow_search): check the case when the length is 1.
+	  The behavior of memcmp is undefined if the third argument is 0.
+
 Mon May 19 21:07:48 2008  Koichi Sasada  <ko1@a...>
 
 	* thread_pthread.c (native_thread_apply_priority): 
Index: regexec.c
===================================================================
--- regexec.c	(revision 16481)
+++ regexec.c	(revision 16482)
@@ -2765,7 +2765,7 @@
       if (*s == *target) {
 	p = s + 1;
 	t = target + 1;
-	if (memcmp(t, p, target_end - t) == 0)
+	if (target_end == t || memcmp(t, p, target_end - t) == 0)
 	  return s;
       }
       s += n;
@@ -2776,7 +2776,7 @@
     if (*s == *target) {
       p = s + 1;
       t = target + 1;
-      if (memcmp(t, p, target_end - t) == 0)
+      if (target_end == t || memcmp(t, p, target_end - t) == 0)
 	return s;
     }
     s += enclen(enc, s, end);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]