[pcre-dev] [Bug 1048] RunGrepTest 62 and 63 fails on s390x a…

Góra strony
Delete this message
Autor: Petr Pisar
Data:  
Dla: pcre-dev
Stare tematy: [pcre-dev] [Bug 1048] New: RunGrepTest 62 and 63 fails on s390x
Temat: [pcre-dev] [Bug 1048] RunGrepTest 62 and 63 fails on s390x and ppc64
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1048




--- Comment #4 from Petr Pisar <ppisar@???> 2010-12-17 13:16:02 ---
It looks like cast to shorter type around pcregrep.c:2311 while converting the
option string to number:

unsigned long int n = 0;
[...]
*((int *)op->dataptr) = n;

However the op->dataptr in case of mathch_limit:

  { OP_NUMBER,    N_M_LIMIT,&match_limit,      "match-limit=number", "set PCRE
match limit option" },


is type of unsigned _long_ int:

static unsigned long int match_limit = 0;

Because on s390x:
sizeof(int)=4, sizeof(unsigned long int)=8

Thus the value of --match-limit argument is written to part at lower address of
the match_limit becoming more significant half of the variable on big endian
machines.


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email