Ignore:
Timestamp:
Aug 31, 2006, 2:28:29 PM (19 years ago)
Author:
thatcher
Message:

Reviewed by Geoff.

Band-aid fix for PCRE to compile for ppc64 and x86_64 now that
we use -Wshorten-64-to-32. Adds an INT_CAST macro that ASSERTs
the value <= INT_MAX.

I filed <rdar://problem/4712064> to track the need to verify
PCRE's 64-bit compliance.

  • pcre/pcre_compile.c: (complete_callout): (compile_branch): (compile_regex): (pcre_compile2):
  • pcre/pcre_exec.c: (match): (pcre_exec):
  • pcre/pcre_get.c: (pcre_get_substring_list):
  • pcre/pcre_internal.h:
  • pcre/pcre_tables.c:
  • pcre/pcre_try_flipped.c: (_pcre_try_flipped):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/pcre/pcre_get.c

    r14457 r16155  
    209209{
    210210int i;
    211 int size = sizeof(char *);
     211int size = (int)sizeof(char *);
    212212int double_count = stringcount * 2;
    213213pcre_char **stringlist;
    214214pcre_char *p;
    215215
    216 for (i = 0; i < double_count; i += 2)
    217   size += sizeof(pcre_char *) + (ovector[i+1] - ovector[i] + 1) * sizeof(pcre_char);
     216for (i = 0; i < double_count; i += 2) {
     217  size += INT_CAST(sizeof(pcre_char *) + (ovector[i+1] - ovector[i] + 1) * sizeof(pcre_char));
     218}
    218219
    219220stringlist = (pcre_char **)(pcre_malloc)(size);
Note: See TracChangeset for help on using the changeset viewer.