Merge branch 'PHP-7.0'

* PHP-7.0:
  add compiler option to disable builtins (special case function calls)
This commit is contained in:
Joe Watkins 2016-05-04 10:54:29 +01:00
commit dc78e02ad2
2 changed files with 11 additions and 2 deletions

View File

@ -3563,6 +3563,14 @@ int zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_l
return FAILURE;
}
if (zend_string_equals_literal(lcname, "assert")) {
return zend_compile_assert(result, args, lcname, fbc);
}
if (CG(compiler_options) & ZEND_COMPILE_NO_BUILTINS) {
return FAILURE;
}
if (zend_string_equals_literal(lcname, "strlen")) {
return zend_compile_func_strlen(result, args);
} else if (zend_string_equals_literal(lcname, "is_null")) {
@ -3597,8 +3605,6 @@ int zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_l
return zend_compile_func_cufa(result, args, lcname);
} else if (zend_string_equals_literal(lcname, "call_user_func")) {
return zend_compile_func_cuf(result, args, lcname);
} else if (zend_string_equals_literal(lcname, "assert")) {
return zend_compile_assert(result, args, lcname, fbc);
} else {
return FAILURE;
}

View File

@ -1019,6 +1019,9 @@ END_EXTERN_C()
/* force IS_OBJ_USE_GUARDS for all classes */
#define ZEND_COMPILE_GUARDS (1<<9)
/* disable builtin special case function calls */
#define ZEND_COMPILE_NO_BUILTINS (1<<10)
/* The default value for CG(compiler_options) */
#define ZEND_COMPILE_DEFAULT ZEND_COMPILE_HANDLE_OP_ARRAY