[#24698] NKF(nkf2)を1.8ブランチに入れました — "NARUSE, Yui" <naruse@...>

naruseです。

14 messages 2004/11/03
[#24734] Re: NKF(nkf2)を1.8ブランチに入れました — 堀川 久 <vzw00011@...> 2004/11/06

こんにちは。

[#24720] メール関係ライブラリの標準添付について — MoonWolf <moonwolf@...>

MoonWolfです。

17 messages 2004/11/05
[#24721] Re: メール関係ライブラリの標準添付について — Yukihiro Matsumoto <matz@...> 2004/11/05

まつもと ゆきひろです

[#24722] Re: メール関係ライブラリの標準添付について — MoonWolf <moonwolf@...> 2004/11/05

MoonWolfです。

[#24804] Re: まつもとさんの負担を減らすために、何ができるだろう — "URABE Shyouhei aka.mput" <root@...>

mput です。 ruby-dev に移動します。

21 messages 2004/11/13
[#24805] Re: まつもとさんの負担を減らすために、何ができるだろう — Tanaka Akira <akr@...17n.org> 2004/11/13

In article <2D6284E3-351D-11D9-B7EF-000393735AAE@mput.dip.jp>,

[#24806] Re: まつもとさんの負担を減らすために、何ができるだろう — "URABE Shyouhei aka.mput" <root@...> 2004/11/13

mput です。

[#24808] Re: まつもとさんの負担を減らすために、何ができるだろう — Masayoshi Takahashi <maki@...> 2004/11/13

高橋征義です。

[#24809] Re: まつもとさんの負担を減らすために、何ができるだろう — "URABE Shyouhei aka.mput" <root@...> 2004/11/13

mput です。

[#24834] Process.getrlimit and Process.setrlimit — Tanaka Akira <akr@...17n.org>

Process.getrlimit と Process.setrlimit が欲しいので実装してみました。

25 messages 2004/11/13

[#24965] sync and stdio buffering — Tanaka Akira <akr@...17n.org>

ちょっとした思いつきなのですが、

12 messages 2004/11/26

[#24993] rb_io_sysread dumps core [BUG] rb_sys_fail() - errno == 0 — Tietew <tietew-ml-ruby-dev@...>

ソケットとスレッドを大量に使うアプリ(具体的には IRCbot です)を

13 messages 2004/11/29

[#25003] IO#flush dumps core again — Tanaka Akira <akr@...17n.org>

次のようにすると core を吐きます。

28 messages 2004/11/30
[#25004] Re: IO#flush dumps core again — nobu@... 2004/11/30

なかだです。

[#25005] Re: IO#flush dumps core again — Yukihiro Matsumoto <matz@...> 2004/11/30

まつもと ゆきひろです

[#25009] Re: IO#flush dumps core again — Tanaka Akira <akr@...17n.org> 2004/12/01

In article <1101836040.635395.27476.nullmailer@x31.priv.netlab.jp>,

[#25014] Re: IO#flush dumps core again — Tanaka Akira <akr@...17n.org> 2004/12/01

In article <1101878558.979715.1359.nullmailer@x31.priv.netlab.jp>,

[#25015] Re: IO#flush dumps core again — Yukihiro Matsumoto <matz@...> 2004/12/01

まつもと ゆきひろです

[#25056] Re: IO#flush dumps core again — Tanaka Akira <akr@...17n.org> 2004/12/05

In article <1101888165.570792.4192.nullmailer@x31.priv.netlab.jp>,

[#25074] Re: IO#flush dumps core again — Tanaka Akira <akr@...17n.org> 2004/12/06

In article <1102293033.356112.2288.nullmailer@x31.priv.netlab.jp>,

[ruby-dev:24856] Re: imported Oni Guruma 3.4.0

From: "K.Kosako" <kosako@...>
Date: 2004-11-15 09:43:08 UTC
List: ruby-dev #24856
>> 鬼車 3.4.0 を CVS HEAD に import しました。
>> [ruby-dev:23658] の parse.y、re.c へのパッチを当たるように変更して
>> 適用してあります。make test, test-all, (鬼車の) test.rb の動作と、
>> [ruby-dev:24645] の big regexp テストが 50000 以上動くところまでは
>> 一応確認しました。
>> 
>> 不具合などあれば連絡していただけると助かります。
>
> HP-UX だとマッチが変なようです。

環境がないので確認はできないのですが、
多分、regint.hの中の定義に矛盾がある
ことが原因と思います。
(以下に含まれないプラットフォームでのみ
起きるバグです。)

#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
    (defined(__ppc__) && defined(__APPLE__)) || \
    defined(__x86_64) || defined(__x86_64__) || \
    defined(__mc68020__)
#define PLATFORM_UNALIGNED_WORD_ACCESS
#endif

[ruby-core:3733]もそれが原因ではないかと
思うのですが。

先週、UK-taniyamaさんから報告を受けていて、
それを元にしたパッチを添付します。
--
小迫@ソフネック   渋谷区恵比寿1-15-1


Index: regcomp.c
===================================================================
RCS file: /home/kosako/cvsrep/oniguruma/regcomp.c,v
retrieving revision 1.6
diff -u -p -r1.6 regcomp.c
--- regcomp.c	18 Oct 2004 11:44:53 -0000	1.6
+++ regcomp.c	9 Nov 2004 05:32:57 -0000
@@ -158,13 +158,7 @@ add_rel_addr(regex_t* reg, int addr)
 {
   RelAddrType ra = (RelAddrType )addr;
 
-#ifdef PLATFORM_UNALIGNED_WORD_ACCESS
   BBUF_ADD(reg, &ra, SIZE_RELADDR);
-#else
-  UChar buf[SERIALIZE_BUFSIZE];
-  SERIALIZE_RELADDR(ra, buf);
-  BBUF_ADD(reg, buf, SIZE_RELADDR);
-#endif
   return 0;
 }
 
@@ -173,13 +167,7 @@ add_abs_addr(regex_t* reg, int addr)
 {
   AbsAddrType ra = (AbsAddrType )addr;
 
-#ifdef PLATFORM_UNALIGNED_WORD_ACCESS
   BBUF_ADD(reg, &ra, SIZE_ABSADDR);
-#else
-  UChar buf[SERIALIZE_BUFSIZE];
-  SERIALIZE_ABSADDR(ra, buf);
-  BBUF_ADD(reg, buf, SIZE_ABSADDR);
-#endif
   return 0;
 }
 
@@ -188,13 +176,7 @@ add_length(regex_t* reg, int len)
 {
   LengthType l = (LengthType )len;
 
-#ifdef PLATFORM_UNALIGNED_WORD_ACCESS
   BBUF_ADD(reg, &l, SIZE_LENGTH);
-#else
-  UChar buf[SERIALIZE_BUFSIZE];
-  SERIALIZE_LENGTH(l, buf);
-  BBUF_ADD(reg, buf, SIZE_LENGTH);
-#endif
   return 0;
 }
 
@@ -203,13 +185,7 @@ add_mem_num(regex_t* reg, int num)
 {
   MemNumType n = (MemNumType )num;
 
-#ifdef PLATFORM_UNALIGNED_WORD_ACCESS
   BBUF_ADD(reg, &n, SIZE_MEMNUM);
-#else
-  UChar buf[SERIALIZE_BUFSIZE];
-  SERIALIZE_MEMNUM(n, buf);
-  BBUF_ADD(reg, buf, SIZE_MEMNUM);
-#endif
   return 0;
 }
 
@@ -219,13 +195,7 @@ add_repeat_num(regex_t* reg, int num)
 {
   RepeatNumType n = (RepeatNumType )num;
 
-#ifdef PLATFORM_UNALIGNED_WORD_ACCESS
   BBUF_ADD(reg, &n, SIZE_REPEATNUM);
-#else
-  UChar buf[SERIALIZE_BUFSIZE];
-  SERIALIZE_REPEATNUM(n, buf);
-  BBUF_ADD(reg, buf, SIZE_REPEATNUM);
-#endif
   return 0;
 }
 #endif
@@ -233,13 +203,7 @@ add_repeat_num(regex_t* reg, int num)
 static int
 add_option(regex_t* reg, OnigOptionType option)
 {
-#ifdef PLATFORM_UNALIGNED_WORD_ACCESS
   BBUF_ADD(reg, &option, SIZE_OPTION);
-#else
-  UChar buf[SERIALIZE_BUFSIZE];
-  SERIALIZE_OPTION(option, buf);
-  BBUF_ADD(reg, buf, SIZE_OPTION);
-#endif
   return 0;
 }
 
@@ -1637,9 +1601,6 @@ unset_addr_list_fix(UnsetAddrList* uslis
   int i, offset;
   EffectNode* en;
   AbsAddrType addr;
-#ifndef PLATFORM_UNALIGNED_WORD_ACCESS
-  UChar buf[SERIALIZE_BUFSIZE];
-#endif
 
   for (i = 0; i < uslist->num; i++) {
     en = &(NEFFECT(uslist->us[i].target));
@@ -1647,12 +1608,7 @@ unset_addr_list_fix(UnsetAddrList* uslis
     addr = en->call_addr;
     offset = uslist->us[i].offset;
 
-#ifdef PLATFORM_UNALIGNED_WORD_ACCESS
     BBUF_WRITE(reg, offset, &addr, SIZE_ABSADDR);
-#else
-    SERIALIZE_ABSADDR(addr, buf);
-    BBUF_WRITE(reg, offset, buf, SIZE_ABSADDR);
-#endif
   }
   return 0;
 }
@@ -5125,8 +5081,7 @@ onig_print_compiled_byte_code(FILE* f, U
     case ARG_NON:
       break;
     case ARG_RELADDR:
-      addr = *((RelAddrType* )bp);
-      bp += SIZE_RELADDR;
+      GET_RELADDR_INC(addr, bp);
       fprintf(f, ":(%d)", addr);
       break;
     case ARG_ABSADDR:
Index: regint.h
===================================================================
RCS file: /home/kosako/cvsrep/oniguruma/regint.h,v
retrieving revision 1.6
diff -u -p -r1.6 regint.h
--- regint.h	30 Oct 2004 03:31:58 -0000	1.6
+++ regint.h	9 Nov 2004 06:50:27 -0000
@@ -580,56 +580,30 @@ typedef short int MemNumType;
 #define SIZE_OPTION        sizeof(OnigOptionType)
 #define SIZE_CODE_POINT    sizeof(OnigCodePoint)
 
-#ifdef PLATFORM_UNALIGNED_WORD_ACCESS
-#define GET_RELADDR_INC(addr,p) do{\
-  addr = *((RelAddrType* )(p));\
-  (p) += SIZE_RELADDR;\
-} while(0)
-
-#define GET_ABSADDR_INC(addr,p) do{\
-  addr = *((AbsAddrType* )(p));\
-  (p) += SIZE_ABSADDR;\
-} while(0)
-
-#define GET_LENGTH_INC(len,p) do{\
-  len = *((LengthType* )(p));\
-  (p) += SIZE_LENGTH;\
-} while(0)
 
-#define GET_MEMNUM_INC(num,p) do{\
-  num = *((MemNumType* )(p));\
-  (p) += SIZE_MEMNUM;\
-} while(0)
 
-#define GET_REPEATNUM_INC(num,p) do{\
-  num = *((RepeatNumType* )(p));\
-  (p) += SIZE_REPEATNUM;\
-} while(0)
+#ifdef PLATFORM_UNALIGNED_WORD_ACCESS
 
-#define GET_OPTION_INC(option,p) do{\
-  option = *((OnigOptionType* )(p));\
-  (p) += SIZE_OPTION;\
+#define PLATFORM_GET_INC(val,p,type) do{\
+  val  = *(type* )p;\
+  (p) += sizeof(type);\
 } while(0)
 
 #else
 
-#define GET_RELADDR_INC(addr,p)      GET_SHORT_INC(addr,p)
-#define GET_ABSADDR_INC(addr,p)      GET_SHORT_INC(addr,p)
-#define GET_LENGTH_INC(len,p)        GET_SHORT_INC(len,p)
-#define GET_MEMNUM_INC(num,p)        GET_SHORT_INC(num,p)
-#define GET_REPEATNUM_INC(num,p)     GET_INT_INC(num,p)
-#define GET_OPTION_INC(option,p)     GET_UINT_INC(option,p)
-
-#define SERIALIZE_RELADDR(addr,p)    SERIALIZE_SHORT(addr,p)
-#define SERIALIZE_ABSADDR(addr,p)    SERIALIZE_SHORT(addr,p)
-#define SERIALIZE_LENGTH(len,p)      SERIALIZE_SHORT(len,p)
-#define SERIALIZE_MEMNUM(num,p)      SERIALIZE_SHORT(num,p)
-#define SERIALIZE_REPEATNUM(num,p)   SERIALIZE_INT(num,p)
-#define SERIALIZE_OPTION(option,p)   SERIALIZE_UINT(option,p)
-
-#define SERIALIZE_BUFSIZE            SIZEOF_INT
+#define PLATFORM_GET_INC(val,p,type) do{\
+  xmemcpy(&val, (p), sizeof(type));\
+  (p) += sizeof(type);\
+} while(0)
 
 #endif  /* PLATFORM_UNALIGNED_WORD_ACCESS */
+
+#define GET_RELADDR_INC(addr,p)    PLATFORM_GET_INC(addr,   p, RelAddrType)
+#define GET_ABSADDR_INC(addr,p)    PLATFORM_GET_INC(addr,   p, AbsAddrType)
+#define GET_LENGTH_INC(len,p)      PLATFORM_GET_INC(len,    p, LengthType)
+#define GET_MEMNUM_INC(num,p)      PLATFORM_GET_INC(num,    p, MemNumType)
+#define GET_REPEATNUM_INC(num,p)   PLATFORM_GET_INC(num,    p, RepeatNumType)
+#define GET_OPTION_INC(option,p)   PLATFORM_GET_INC(option, p, OnigOptionType)
 
 /* code point's address must be aligned address. */
 #define GET_CODE_POINT(code,p)   code = *((OnigCodePoint* )(p))

In This Thread

Prev Next