diff options
author | zherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2011-12-23 20:37:29 +0000 |
---|---|---|
committer | zherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2011-12-23 20:37:29 +0000 |
commit | 8d2226da6db1b735e0639479d609810455444476 (patch) | |
tree | acab7032cf789274e6a4c283767c48560e957716 | |
parent | c08d1a083095944b63ec5400fdaeb7527cbbb702 (diff) | |
download | pcre-8d2226da6db1b735e0639479d609810455444476.tar.gz |
fix 16 bit issues reported by valgrind
git-svn-id: svn://vcs.exim.org/pcre/code/branches/pcre16@822 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r-- | pcre_compile.c | 1 | ||||
-rw-r--r-- | pcre_jit_compile.c | 7 | ||||
-rw-r--r-- | pcretest.c | 6 |
3 files changed, 10 insertions, 4 deletions
diff --git a/pcre_compile.c b/pcre_compile.c index 3dfce13..031becb 100644 --- a/pcre_compile.c +++ b/pcre_compile.c @@ -7749,6 +7749,7 @@ cd->workspace_size = COMPILE_WORK_SIZE; cd->start_pattern = (const pcre_uchar *)pattern; cd->end_pattern = (const pcre_uchar *)(pattern + STRLEN_UC((const pcre_uchar *)pattern)); cd->req_varyopt = 0; +cd->assert_depth = 0; cd->external_options = options; cd->external_flags = 0; cd->open_caps = NULL; diff --git a/pcre_jit_compile.c b/pcre_jit_compile.c index 5a37c6e..7f9df74 100644 --- a/pcre_jit_compile.c +++ b/pcre_jit_compile.c @@ -1497,7 +1497,7 @@ JUMPHERE(jump); static void skip_char_back(compiler_common *common) { -/* Goes one character back. Only affects STR_PTR. Does not check begin. */ +/* Goes one character back. Affects STR_PTR and TMP1. Does not check begin. */ DEFINE_COMPILER; #if defined SUPPORT_UTF && defined COMPILE_PCRE8 struct sljit_label *label; @@ -3403,19 +3403,20 @@ switch(type) length = GET(cc, 0); SLJIT_ASSERT(length > 0); OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0); - OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin)); #ifdef SUPPORT_UTF if (common->utf) { + OP1(SLJIT_MOV, TMP3, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin)); OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, length); label = LABEL(); - add_jump(compiler, fallbacks, CMP(SLJIT_C_LESS_EQUAL, STR_PTR, 0, TMP1, 0)); + add_jump(compiler, fallbacks, CMP(SLJIT_C_LESS_EQUAL, STR_PTR, 0, TMP3, 0)); skip_char_back(common); OP2(SLJIT_SUB | SLJIT_SET_E, TMP2, 0, TMP2, 0, SLJIT_IMM, 1); JUMPTO(SLJIT_C_NOT_ZERO, label); return cc + LINK_SIZE; } #endif + OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin)); OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(length)); add_jump(compiler, fallbacks, CMP(SLJIT_C_LESS, STR_PTR, 0, TMP1, 0)); return cc + LINK_SIZE; @@ -2855,7 +2855,7 @@ while (!done) int count, backrefmax, first_char, need_char, okpartial, jchanged, hascrorlf; int nameentrysize, namecount; - const pcre_uchar *nametable; + const pcre_uint8 *nametable; new_info(re, NULL, PCRE_INFO_SIZE, &size); new_info(re, NULL, PCRE_INFO_CAPTURECOUNT, &count); @@ -2898,7 +2898,11 @@ while (!done) nametable += nameentrysize * (use_pcre16 ? 2 : 1); #else fprintf(outfile, "%3d\n", GET2(nametable, 0)); +#ifdef SUPPORT_PCRE8 nametable += nameentrysize; +#else + nametable += nameentrysize * 2; +#endif #endif } } |