Dmitry Stogov [Fri, 20 Mar 2015 22:00:00 +0000 (01:00 +0300)]
Merge branch 'scalar_type_hints_v5'
* scalar_type_hints_v5: (65 commits)
Fixed in-place modification of IS_CONST operand
Changed SKIPIF messages
ZPP changed to lazely check for "strict/weak" only if it's really necessary. Cleanup.
cleanup
Fixed return type hint handling for constants
Fixed tests
Imroved ZPP rules (condititins reoredered to prevent duplicate checks)
Fixed comments
Fixed error messages
Improved type hinting:
Fixed white spaces
Add check for maintaining reference all the way through both type and return values
Reduce the number of times that the zval needs to be separated in return type checking to those that are necessary
Add test to ensure namespaced code can't use scalar types as class names
Disallow relative namespace type declarations
Add support and tests for null constant default values. Refactor complex conditionals into an extracted function for clarity and code-reuse
Refactor as to not use call info, but add the flag to the op_array.
Fix severity issues with callbacks, start work porting ZEND_STRLEN opcode to work with strict mode, more refactoring to come
Fix C89 compatibility by moving a misplaced if statement
Refactor gotos into more elaborate ifs to eliminate goto failure
...
Dmitry Stogov [Fri, 20 Mar 2015 13:04:04 +0000 (16:04 +0300)]
Improved type hinting:
EX_PREV_USES_STRICT_TYPES() and family changed/renamed to fit with other macros
Optimized zend_verify_internal_arg_type() and family (they don't need "strict" argument anymore)
Standerd ZPP is called from VM only for weak type check or strict exception (int -> double)
Fixed ZEND_RECV_VARIADIC
Fixed ZEND_STRLEN
TODO: should we accept IS_NULL for non-nullable arguments?
Dmitry Stogov [Fri, 20 Mar 2015 07:51:41 +0000 (10:51 +0300)]
Merge branch 'scalar_type_hints_v5' of github.com:ircmaxell/php-src into scalar_type_hints_v5
* 'scalar_type_hints_v5' of github.com:ircmaxell/php-src: (54 commits)
Add check for maintaining reference all the way through both type and return values
Reduce the number of times that the zval needs to be separated in return type checking to those that are necessary
Add test to ensure namespaced code can't use scalar types as class names
Disallow relative namespace type declarations
Add support and tests for null constant default values. Refactor complex conditionals into an extracted function for clarity and code-reuse
Refactor as to not use call info, but add the flag to the op_array.
Fix severity issues with callbacks, start work porting ZEND_STRLEN opcode to work with strict mode, more refactoring to come
Fix C89 compatibility by moving a misplaced if statement
Refactor gotos into more elaborate ifs to eliminate goto failure
Fix return type separation with references. It now includes a check in the opcode handler and properly separates the value in both cases
Add error case with invalid type declaration default value
Add tests for using constants as defaults with scalar type declarations
Refactor error messages to only append defined in the event of rendering as a fatal error. Fix relative typehints to not work
Revert gd and mysqli to former calls for arg count errors. Fix first identified issues with zend_compile.c from nikic. Add tests for generator returns prior to first yield
Style cleanup, as well as fixing bug with missing argument for WRONG_PARAM_COUNT_WITH_RETVAL
Clean up API renames for zend_wrong_param_count to maintain BC, introducing a zend_wrong_param_count_ex() function when you know strict value
Fix executor issue with ignoring strict types, which cleans up a bunch of errors. Additionally fix the expected error of 2 unrelated tests that was caused by a change to the core error messages
Fix more tests, improve error messages in failure output for thrown exception
Refactor error implementation significantly to centralize error mode behavior. Add zend_internal_type_error() function
Refactor declare placement detection, allow encoding declares before type declares
...
Lior Kaplan [Thu, 19 Mar 2015 00:47:22 +0000 (02:47 +0200)]
Merge branch 'PHP-5.6'
* PHP-5.6:
Add CVE to bug #69253
Align entries format
Add CVE assigned to 5.6.6 bugs after the release
Add CVE to bug #69248
Align entries format
Add CVE to bug #69248
Add CVE assigned to 5.5.22 bugs after the release
Bob Weinand [Wed, 18 Mar 2015 21:25:55 +0000 (22:25 +0100)]
Remove bogus ZEND_ASSERT(hash != 0)
There's always a possibility that the has will end up as equal to zero due to overflowing.
See the tests for strings whose hash overflow.
Yes, there's a check for whether the hash already was calculated... and strings with a hash equal to zero always need the hash recalculated, in one of 2^32 respectively 2^64 cases - which should not be a major issue.
Anthony Ferrara [Wed, 18 Mar 2015 20:14:02 +0000 (16:14 -0400)]
Revert gd and mysqli to former calls for arg count errors. Fix first identified issues with zend_compile.c from nikic. Add tests for generator returns prior to first yield
Anthony Ferrara [Wed, 18 Mar 2015 19:22:21 +0000 (15:22 -0400)]
Fix executor issue with ignoring strict types, which cleans up a bunch of errors. Additionally fix the expected error of 2 unrelated tests that was caused by a change to the core error messages
Dmitry Stogov [Wed, 18 Mar 2015 12:31:29 +0000 (15:31 +0300)]
Reimplemented special constant handling. Now __HALT_COMPILER_OFFSET__ is resolved at compile-time. __CLASS__ retrived using separate ZEND_FETCH_CLASS_NAME opcode.