diff options
author | Zeev Suraski <zeev@php.net> | 2003-08-18 23:11:58 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2003-08-18 23:11:58 +0000 |
commit | 6ab9c1a336857d425cc1b3c0c92ed27f688d06ad (patch) | |
tree | 06e649c4c2d731253024582a5274f0b79e9fdd07 | |
parent | c23609efa7b90b9808521b1c7e056885bb605593 (diff) | |
download | php-git-6ab9c1a336857d425cc1b3c0c92ed27f688d06ad.tar.gz |
Prevent access to internal engine functionality
-rw-r--r-- | Zend/ZendTS.dsp | 26 | ||||
-rw-r--r-- | Zend/zend_execute.c | 31 | ||||
-rw-r--r-- | Zend/zend_execute_locks.h | 61 |
3 files changed, 42 insertions, 76 deletions
diff --git a/Zend/ZendTS.dsp b/Zend/ZendTS.dsp index f8dbbc9ab4..9615542324 100644 --- a/Zend/ZendTS.dsp +++ b/Zend/ZendTS.dsp @@ -7,21 +7,21 @@ CFG=ZendTS - Win32 Release_TSDbg
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "ZendTS.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "ZendTS.mak" CFG="ZendTS - Win32 Release_TSDbg"
-!MESSAGE
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
+!MESSAGE
!MESSAGE "ZendTS - Win32 Release_TS" (based on "Win32 (x86) Static Library")
!MESSAGE "ZendTS - Win32 Debug_TS" (based on "Win32 (x86) Static Library")
!MESSAGE "ZendTS - Win32 Release_TS_inline" (based on "Win32 (x86) Static Library")
!MESSAGE "ZendTS - Win32 Release_TSDbg" (based on "Win32 (x86) Static Library")
-!MESSAGE
+!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
@@ -119,7 +119,7 @@ LIB32=link.exe -lib # ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
-!ENDIF
+!ENDIF
# Begin Target
@@ -324,10 +324,6 @@ SOURCE=.\zend_execute.h # End Source File
# Begin Source File
-SOURCE=.\zend_execute_locks.h
-# End Source File
-# Begin Source File
-
SOURCE=.\zend_extensions.h
# End Source File
# Begin Source File
@@ -510,7 +506,7 @@ BuildCmds= \ $(BuildCmds)
# End Custom Build
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -581,7 +577,7 @@ BuildCmds= \ $(BuildCmds)
# End Custom Build
-!ENDIF
+!ENDIF
# End Source File
# End Group
@@ -636,7 +632,7 @@ InputPath=.\zend_ini_scanner.l # End Custom Build
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -683,7 +679,7 @@ InputPath=".\zend_language_scanner.l" # End Custom Build
-!ENDIF
+!ENDIF
# End Source File
# End Group
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 584d979a42..f5d4d85800 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -52,6 +52,37 @@ static void zend_extension_fcall_end_handler(zend_extension *extension, zend_op_ #define EX_T(offset) (*(temp_variable *)((char *) EX(Ts) + offset)) #define T(offset) (*(temp_variable *)((char *) Ts + offset)) + +/* former zend_execute_locks.h */ +static inline void zend_pzval_lock_func(zval *z) +{ + z->refcount++; +} + + +static inline void zend_pzval_unlock_func(zval *z TSRMLS_DC) +{ + z->refcount--; + if (!z->refcount) { + z->refcount = 1; + z->is_ref = 0; + EG(garbage)[EG(garbage_ptr)++] = z; + } +} + +static inline void zend_clean_garbage(TSRMLS_D) +{ + while (EG(garbage_ptr)) { + zval_ptr_dtor(&EG(garbage)[--EG(garbage_ptr)]); + } +} + +#define PZVAL_UNLOCK(z) zend_pzval_unlock_func(z TSRMLS_CC) +#define PZVAL_LOCK(z) zend_pzval_lock_func(z) +#define SELECTIVE_PZVAL_LOCK(pzv, pzn) if (!((pzn)->u.EA.type & EXT_TYPE_UNUSED)) { PZVAL_LOCK(pzv); } + +/* End of zend_execute_locks.h */ + static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, zval **should_free TSRMLS_DC) { switch (node->op_type) { diff --git a/Zend/zend_execute_locks.h b/Zend/zend_execute_locks.h deleted file mode 100644 index 7830fa6da5..0000000000 --- a/Zend/zend_execute_locks.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2003 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans <andi@zend.com> | - | Zeev Suraski <zeev@zend.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_EXECUTE_LOCKS_H -#define ZEND_EXECUTE_LOCKS_H - -#define PZVAL_LOCK(z) zend_pzval_lock_func(z) - -static inline void zend_pzval_lock_func(zval *z) -{ - z->refcount++; -} - -#define PZVAL_UNLOCK(z) zend_pzval_unlock_func(z TSRMLS_CC) - -static inline void zend_pzval_unlock_func(zval *z TSRMLS_DC) -{ - z->refcount--; - if (!z->refcount) { - z->refcount = 1; - z->is_ref = 0; - EG(garbage)[EG(garbage_ptr)++] = z; - } -} - -static inline void zend_clean_garbage(TSRMLS_D) -{ - while (EG(garbage_ptr)) { - zval_ptr_dtor(&EG(garbage)[--EG(garbage_ptr)]); - } -} - -#define SELECTIVE_PZVAL_LOCK(pzv, pzn) if (!((pzn)->u.EA.type & EXT_TYPE_UNUSED)) { PZVAL_LOCK(pzv); } - -#endif /* ZEND_EXECUTE_LOCKS_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ |