diff options
author | chpe <chpe@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2012-10-16 15:54:02 +0000 |
---|---|---|
committer | chpe <chpe@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2012-10-16 15:54:02 +0000 |
commit | 183f5f1cd8c28db6df97d2d804de5ac06b9fdbe9 (patch) | |
tree | 468a34d7c4fe9a4c97df2da7799cf0e60cac1f42 /pcre_internal.h | |
parent | 446112f8318dd695eb42a0390bf4883ef4bb52f5 (diff) | |
download | pcre-183f5f1cd8c28db6df97d2d804de5ac06b9fdbe9.tar.gz |
pcre32: compile: Encode back references as negative numbers
Return the back reference as negative numbers from check_escape(),
instead of adding them to ESC_REF. This way, there will never be an
overflow.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1061 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'pcre_internal.h')
-rw-r--r-- | pcre_internal.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/pcre_internal.h b/pcre_internal.h index 1696a13..1e80f11 100644 --- a/pcre_internal.h +++ b/pcre_internal.h @@ -1775,8 +1775,8 @@ when PCRE_UCP is set and replacement of \d etc by \p sequences is required. They must be contiguous, and remain in order so that the replacements can be looked up from a table. -The final escape must be ESC_REF as subsequent values are used for -backreferences (\1, \2, \3, etc). There are two tests in the code for an escape +Negative numbers are used to encode a backreference (\1, \2, \3, etc.) in +check_escape(). There are two tests in the code for an escape greater than ESC_b and less than ESC_Z to detect the types that may be repeated. These are the types that consume characters. If any new escapes are put in between that don't consume a character, that code will have to change. @@ -1786,8 +1786,7 @@ enum { ESC_A = 1, ESC_G, ESC_K, ESC_B, ESC_b, ESC_D, ESC_d, ESC_S, ESC_s, ESC_W, ESC_w, ESC_N, ESC_dum, ESC_C, ESC_P, ESC_p, ESC_R, ESC_H, ESC_h, ESC_V, ESC_v, ESC_X, ESC_Z, ESC_z, ESC_E, ESC_Q, ESC_g, ESC_k, - ESC_DU, ESC_du, ESC_SU, ESC_su, ESC_WU, ESC_wu, - ESC_REF }; + ESC_DU, ESC_du, ESC_SU, ESC_su, ESC_WU, ESC_wu }; /* Opcode table: Starting from 1 (i.e. after OP_END), the values up to OP_EOD must correspond in order to the list of escapes immediately above. |