summaryrefslogtreecommitdiff
path: root/ext/pcre/pcrelib/pcre_refcount.c
diff options
context:
space:
mode:
authorULF WENDEL <uw@php.net>2012-10-22 13:38:02 +0200
committerULF WENDEL <uw@php.net>2012-10-22 13:38:02 +0200
commit77fd708a0b81bf6dfcfce6aba24eaa606b97f630 (patch)
tree08ac6b2b913d20b60c18909986d1106010b538cb /ext/pcre/pcrelib/pcre_refcount.c
parentc64ff20836173fc35a22092b9e586f80ac722e22 (diff)
parent7d59b2264e4ea75c34c86df756a2c2795b94753f (diff)
downloadphp-git-77fd708a0b81bf6dfcfce6aba24eaa606b97f630.tar.gz
Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4
* 'PHP-5.4' of git.php.net:php-src: (22 commits) Re-fixed bug #60901 (Improve "tail" syntax for AIX installation) update NEWS updated NEWS Fixed bug #63284 PCRE upgrade to 8.31 preg indenpent test script for #63055 Update libmagic.patch Add fix & missing fix Add fix & missing fix Fixed bug #63307 (Unused variable in oci8.c) Fixed bug #63265 (Add ORA-00028 to the PHP_OCI_HANDLE_ERROR macro) - Updated to version 2012.7 (2012g) SUpport newer bisons. Merge the fix for #61964 to 5.3, which will fix #63304 indent better fix for #63055 Fixed bug #63055 (Segfault in zend_gc with SF2 testsuite) I forgot that inconsistent is only avaliable in debug mode Add comments Fixed bug #63055 (Segfault in zend_gc with SF2 testsuite) PHP 5.3.18 NEWS ...
Diffstat (limited to 'ext/pcre/pcrelib/pcre_refcount.c')
-rw-r--r--ext/pcre/pcrelib/pcre_refcount.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/pcre/pcrelib/pcre_refcount.c b/ext/pcre/pcrelib/pcre_refcount.c
index c92d578e6e..ec16713f0b 100644
--- a/ext/pcre/pcrelib/pcre_refcount.c
+++ b/ext/pcre/pcrelib/pcre_refcount.c
@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
- Copyright (c) 1997-2008 University of Cambridge
+ Copyright (c) 1997-2012 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -66,11 +66,18 @@ Returns: the (possibly updated) count value (a non-negative number), or
a negative error number
*/
+#ifdef COMPILE_PCRE8
PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
pcre_refcount(pcre *argument_re, int adjust)
+#else
+PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
+pcre16_refcount(pcre16 *argument_re, int adjust)
+#endif
{
-real_pcre *re = (real_pcre *)argument_re;
+REAL_PCRE *re = (REAL_PCRE *)argument_re;
if (re == NULL) return PCRE_ERROR_NULL;
+if (re->magic_number != MAGIC_NUMBER) return PCRE_ERROR_BADMAGIC;
+if ((re->flags & PCRE_MODE) == 0) return PCRE_ERROR_BADMODE;
re->ref_count = (-adjust > re->ref_count)? 0 :
(adjust + re->ref_count > 65535)? 65535 :
re->ref_count + adjust;