summaryrefslogtreecommitdiff
path: root/Zend/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fixed bug #80334Nikita Popov2020-11-091-0/+30
| | | | | If assert() was called with named args, add description as named arg as well.
* Don't xfail method_static_var.phptNikita Popov2020-11-041-16/+11
| | | | | | | | Let's test the current behavior here. It might not be right, but it's long-standing behavior. Nearly missed an assertion failure here because the test was XFAILed...
* Don't disable opcache for generic testsNikita Popov2020-11-049-18/+0
| | | | | Even if the original issue only reproduces without opcache, we should still allow running them with and without opcache.
* Improved error message for typed class properties with null as default valueBogdan Ungureanu2020-11-031-0/+15
| | | | Closes GH-6396.
* Fix test added in d44235acaeb4Alex Dowad2020-10-301-2/+0
|
* Convert numeric string array keys to integers correctly in JITted codeAlex Dowad2020-10-302-0/+28
| | | | | | | | | | | | | While fixing bugs in mbstring, one of my new test cases failed with a strange error message stating: 'Warning: Undefined array key 1...', when clearly the array key had been set properly. GDB'd that sucker and found that JIT'd PHP code was calling directly into `zend_hash_add_new` (which was not converting the numeric string key to an integer properly). But where was that code coming from? I examined the disasm, looked up symbols to figure out where call instructions were going, then grepped the codebase for those function names. It soon became clear that the disasm I was looking at was compiled from `zend_jit_fetch_dim_w_helper`.
* Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2020-10-301-0/+18
|\ | | | | | | | | * PHP-7.4: Fix SSA integrity violation for type inference in dead code
| * Fix SSA integrity violation for type inference in dead codeNikita Popov2020-10-301-0/+18
| | | | | | | | | | | | The foreach body can never be executed and thus may contain empty types. We should still uphold our SSA integrity invariants in that case.
* | Don't allow passing unknown named params to class without ctorNikita Popov2020-10-231-0/+23
| | | | | | | | | | | | See also https://externals.io/message/112083. Closes GH-6364.
* | Run arginfo/ZPP verification tests in strict mode as wellMáté Kocsis2020-10-223-31/+127
| | | | | | | | Closes GH-6370
* | Simplify and fix generator tree managementNikita Popov2020-10-223-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes a number of related changes to the generator tree management, that should hopefully make it easier to understand, more robust and faster for the common linear-chain case. Fixes https://bugs.php.net/bug.php?id=80240, which was the original motivation here. * Generators now only add a ref to their direct parent. * Nodes only store their children, not their leafs, which avoids any need for leaf updating. This means it's no longer possible to fetch the child for a certain leaf, which is something we only needed in one place (update_current). If multi-children nodes are involved, this will require doing a walk in the other direction (from leaf to root). It does not affect the common case of single-child nodes. * The root/leaf pointers are now seen as a pair. One leaf generator can point to the current root. If a different leaf generator is used, we'll move the root pointer over to that one. Again, this is a cache to make the common linear chain case fast, trees may need to scan up the parent link. Closes GH-6344.
* | Fixed bug #80255Nikita Popov2020-10-191-0/+24
| | | | | | | | | | | | This was a copy&paste mistake, target_block was used where follow_block was intended. Also update copy&paste mistakes in the comments.
* | Make sure output start filename is not freed earlyNikita Popov2020-10-161-0/+11
| | | | | | | | | | | | | | | | As filenames are no longer interned, we need to keep a reference to the zend_string to make sure it isn't freed. To avoid a nominal source compatibility break, create a new member in the globals.
* | Fix leak when setting dynamic property on generatorNikita Popov2020-10-161-1/+1
| |
* | Fix bug #80055Nikita Popov2020-10-151-0/+24
| | | | | | | | | | | | | | We need to perform trait scope fixup for both methods involved in the inheritance check. For that purpose we already need to thread through a separate fn scope through the entire inheritance checking machinery.
* | Skip arginfo test under msanNikita Popov2020-10-151-0/+4
| | | | | | | | | | Msan is missing interceptors for some functions that result in false positives.
* | More arginfo/zpp verificationNikita Popov2020-10-141-16/+75
| | | | | | | | | | | | | | Run all functions with a varying number of null arguments, which helps us flush out all kinds of bugs. Closes GH-5881.
* | Fix handling of throwing undef var in verify returnNikita Popov2020-10-131-0/+23
| | | | | | | | | | | | | | | | | | | | If we have an undefined variable and null is not accepted by the return type, we want to throw just the undef var error. In this case this lead to an infinite loop, because we overwrite the exception opline in SAVE_OPLINE and it does not get reset when chaining into a previous exception. Add an assertiong to catch this case earlier.
* | Fixed bug #80225Nikita Popov2020-10-121-0/+10
| | | | | | | | | | Namespaced and declares have a different interpretation of what "first statement" means.
* | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2020-10-122-0/+26
|\ \ | |/ | | | | | | | | * PHP-7.4: Detect self-addition of array more accurately Deindirect source elements in zend_hash_merge
| * Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-10-122-0/+26
| |\ | | | | | | | | | | | | | | | * PHP-7.3: Detect self-addition of array more accurately Deindirect source elements in zend_hash_merge
| | * Detect self-addition of array more accuratelyNikita Popov2020-10-121-0/+10
| | | | | | | | | | | | | | | | | | | | | While the zvals may be different, they may still point to the same array. Fixes oss-fuzz #26245.
| | * Deindirect source elements in zend_hash_mergeNikita Popov2020-10-121-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | If the RHS has INDIRECT elements, we do not those to be added to the LHS verbatim. As we're using UPDATE_INDIRECT, we might even create a nested INDIRECT that way. This is a side-quest of oss-fuzz #26245.
* | | Merge branch 'PHP-7.4'Nikita Popov2020-10-071-0/+22
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fixed bug #80194
| * | Fixed bug #80194Nikita Popov2020-10-071-0/+22
| | | | | | | | | | | | | | | We should strip NOPs from unreachable_free blocks as well, to make sure that the free really is the first op.
* | | Merge branch 'PHP-7.4'Nikita Popov2020-10-062-0/+50
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix bug #80126
| * | Fix bug #80126Nikita Popov2020-10-062-0/+50
| | | | | | | | | | | | | | | | | | When performing an unlinked instanceof, we also need to consider interfaces of parent classes, as they may not have been inherited yet.
* | | Fix bug #80184Nikita Popov2020-10-051-0/+20
| | |
* | | Return correct result code for division by zeroNikita Popov2020-10-021-0/+11
| | | | | | | | | | | | | | | | | | | | | Turns out we do need to return FAILURE here on div by zero exception. Use a three-way return value from div_function_base. Fixes oss-fuzz #25975.
* | | Add test instantiating all objectsNikita Popov2020-10-011-0/+15
| | | | | | | | | | | | | | | | | | Intended to find issues in opaque object destructors. Closes GH-6251.
* | | Update ext/standard parameter namesNikita Popov2020-09-294-10/+10
| | | | | | | | | | | | Closes GH-6214.
* | | Zend parameter renames amendmentMáté Kocsis2020-09-292-4/+4
| | | | | | | | | | | | Closes GH-6228
* | | Update PDO parameters for named arguments.Larry Garfield2020-09-281-1/+1
| | | | | | | | | | | | Closes GH-6220
* | | Allow attributes to be applied to property/constant groupsNikita Popov2020-09-272-10/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove arbitrary restriction that attributes cannot be applied to property/constant groups. The attribute applies to all elements of the group, just like modifiers and types do. See also https://externals.io/message/111914. Closes GH-6186.
* | | Make constexpr compilation robust against multiple compilationNikita Popov2020-09-271-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of setting the old AST type to zero, replace the AST with the compiled constexpr AST zval. This requires passing in a zend_ast** instead of a zend_ast*. This allows compiling ASTs containing constexprs multiple times -- the second time, the existing compiled representation will be resused. This means we no longer need to copy the attributes AST for promoted properties.
* | | Honor strict_types=1 for attributes, improve backtracesNikita Popov2020-09-274-3/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make ReflectionAttribute::newInstance() respect the strict_types=1 declaration at the attribute use-site. More generally, pretend that we are calling the attribute constructor from the place where the attribute is used, which also means that the attribute location will show up properly in backtraces and inside "called in" error information. This requires us to store the attributes strict_types scope (as flags), as well as the attribute line number. The attribute filename can be recovered from the symbol it is used on. We might want to expose the attribute line number via reflection as well. See also https://externals.io/message/111915. Closes GH-6201.
* | | Use C zpp for get_class_vars()Nikita Popov2020-09-221-0/+7
| | |
* | | Promote count() warning to TypeErrorGeorge Peter Banyard2020-09-211-4/+4
| | | | | | | | | | | | Closes GH-6180
* | | Throw warning for failed object to int/float conversionNikita Popov2020-09-216-7/+7
| | | | | | | | | | | | | | | | | | We previously couldn't increase the error level here because it was coupled to comparison handling. This is no longer the case in PHP 8.
* | | Make constant redeclaration a warningNikita Popov2020-09-217-8/+8
| | | | | | | | | | | | | | | | | | We missed the change to make this an Error exception in PHP 8, but at least elevate it to a warning, to avoid a notice -> exception jump at a later time.
* | | Synchronize GET_CLASS/GET_CALLED_CLASS opcodes with functionsNikita Popov2020-09-213-14/+15
| | | | | | | | | | | | | | | These error conditions throw in the function implementations, make the opcodes match.
* | | Use proper parameter type in Closure::bindTo() signatureNikita Popov2020-09-211-4/+6
| | |
* | | Improve default value handling of Exception constructorsMáté Kocsis2020-09-211-0/+63
| | | | | | | | | | | | Closes GH-6166
* | | Fix detection of code outside namespaceNikita Popov2020-09-213-9/+26
| | | | | | | | | | | | | | | | | | Due to improvements to early binding, the opcode based check is no longer accurate. Reuse the syntactic check we're already using for declares instead.
* | | Initialize attributes for internal functionsNikita Popov2020-09-211-0/+32
| | | | | | | | | | | | Fixes a crash in Symfony SecurityBundle tests.
* | | Run tidyNikita Popov2020-09-1842-170/+170
| | | | | | | | | | | | | | | This should fix most of the remaining issues with tabs and spaces being mixed in tests.
* | | Fix OSS Fuzz issue: yielding from an aborted generatorBob Weinand2020-09-151-0/+31
| | |
* | | Fix uninitialized run-time cache when resolving named param defaultsNikita Popov2020-09-151-0/+17
| | | | | | | | | | | | Fixes oss-fuzz #25676.
* | | Fix undef var exception handling in JMP_NULLNikita Popov2020-09-151-0/+18
| | | | | | | | | | | | | | | | | | | | | We need to initialize the result variable in the exceptional case as well. Fixes oss-fuzz #25526.
* | | Merge branch 'PHP-7.4'Nikita Popov2020-09-151-0/+16
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix assumption about property guard hash value