diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2010-03-03 19:29:38 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2010-03-03 19:29:38 +0000 |
commit | 7887b1dc1c1c7276d3f95aa3920e1c5997ea3480 (patch) | |
tree | aa94d0decf473fd5987277e922934fbb420b1d07 /pcre_printint.src | |
parent | d3ebf28a7ff375fe7681717ef4b0056138564e39 (diff) | |
download | pcre-7887b1dc1c1c7276d3f95aa3920e1c5997ea3480.tar.gz |
Fix missing data in coptable and poptable vectors; add compile-time checks for
their lengths.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@498 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'pcre_printint.src')
-rw-r--r-- | pcre_printint.src | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/pcre_printint.src b/pcre_printint.src index 9b2def1..86b02b5 100644 --- a/pcre_printint.src +++ b/pcre_printint.src @@ -190,6 +190,25 @@ for(;;) switch(*code) { +/* ========================================================================== */ + /* These cases are never obeyed. This is a fudge that causes a compile- + time error if the vectors OP_names or _pcre_OP_lengths, which are indexed + by opcode, are not the correct length. It seems to be the only way to do + such a check at compile time, as the sizeof() operator does not work in + the C preprocessor. We do this while compiling pcretest, because that + #includes pcre_tables.c, which holds _pcre_OP_lengths. We can't do this + when building pcre_compile.c with PCRE_DEBUG set, because it doesn't then + know the size of _pcre_OP_lengths. */ + +#ifdef COMPILING_PCRETEST + case OP_TABLE_LENGTH: + case OP_TABLE_LENGTH + + ((sizeof(OP_names)/sizeof(const char *) == OP_TABLE_LENGTH) && + (sizeof(_pcre_OP_lengths) == OP_TABLE_LENGTH)): + break; +#endif +/* ========================================================================== */ + case OP_END: fprintf(f, " %s\n", OP_names[*code]); fprintf(f, "------------------------------------------------------------------\n"); |