/[pcre]/code/branches/pcre16/pcretest.c
ViewVC logotype

Diff of /code/branches/pcre16/pcretest.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 667 by ph10, Mon Aug 22 14:57:32 2011 UTC revision 676 by ph10, Sat Aug 27 15:53:04 2011 UTC
# Line 229  static const char *errtexts[] = { Line 229  static const char *errtexts[] = {
229    "invalid combination of newline options",    "invalid combination of newline options",
230    "bad offset value",    "bad offset value",
231    NULL,  /* SHORTUTF8 is handled specially */    NULL,  /* SHORTUTF8 is handled specially */
232    "nested recursion at the same subject position"    "nested recursion at the same subject position",
233      "JIT stack limit reached"
234  };  };
235    
236    
# Line 1050  if ((rc = pcre_fullinfo(re, study, optio Line 1051  if ((rc = pcre_fullinfo(re, study, optio
1051    
1052    
1053  /*************************************************  /*************************************************
1054    *      Check for supported JIT architecture      *
1055    *************************************************/
1056    
1057    /* If it won't JIT-compile a very simple regex, return FALSE. */
1058    
1059    static int check_jit_arch(void)
1060    {
1061    const char *error;
1062    int erroffset, rc;
1063    pcre *re = pcre_compile("abc", 0, &error, &erroffset, NULL);
1064    pcre_extra *extra = pcre_study(re, PCRE_STUDY_JIT_COMPILE, &error);
1065    rc = extra != NULL && (extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) != 0 &&
1066      extra->executable_jit != NULL;
1067    pcre_free_study(extra);
1068    free(re);
1069    return rc;
1070    }
1071    
1072    
1073    /*************************************************
1074  *         Byte flipping function                 *  *         Byte flipping function                 *
1075  *************************************************/  *************************************************/
1076    
# Line 1358  while (argc > 1 && argv[op][0] == '-') Line 1379  while (argc > 1 && argv[op][0] == '-')
1379      (void)pcre_config(PCRE_CONFIG_UNICODE_PROPERTIES, &rc);      (void)pcre_config(PCRE_CONFIG_UNICODE_PROPERTIES, &rc);
1380      printf("  %sUnicode properties support\n", rc? "" : "No ");      printf("  %sUnicode properties support\n", rc? "" : "No ");
1381      (void)pcre_config(PCRE_CONFIG_JIT, &rc);      (void)pcre_config(PCRE_CONFIG_JIT, &rc);
1382      printf("  %sJust-in-time compiler support\n", rc? "" : "No ");      if (rc)
1383          printf("  Just-in-time compiler support%s\n", check_jit_arch()?
1384            "" : " (but this architecture is unsupported)");
1385        else
1386          printf("  No just-in-time compiler support\n");
1387      (void)pcre_config(PCRE_CONFIG_NEWLINE, &rc);      (void)pcre_config(PCRE_CONFIG_NEWLINE, &rc);
1388      /* Note that these values are always the ASCII values, even      /* Note that these values are always the ASCII values, even
1389      in EBCDIC environments. CR is 13 and NL is 10. */      in EBCDIC environments. CR is 13 and NL is 10. */
# Line 2497  while (!done) Line 2522  while (!done)
2522            {            {
2523            if (jit_stack != NULL) pcre_jit_stack_free(jit_stack);            if (jit_stack != NULL) pcre_jit_stack_free(jit_stack);
2524            jit_stack = pcre_jit_stack_alloc(1, n * 1024);            jit_stack = pcre_jit_stack_alloc(1, n * 1024);
2525            pcre_assign_jit_callback(extra, jit_callback, jit_stack);            pcre_assign_jit_stack(extra, jit_callback, jit_stack);
2526            }            }
2527          continue;          continue;
2528    

Legend:
Removed from v.667  
changed lines
  Added in v.676

  ViewVC Help
Powered by ViewVC 1.1.5