summaryrefslogtreecommitdiff
path: root/Zend/tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2021-02-151-0/+19
|\ | | | | | | | | * PHP-7.4: Fix symtable cache being used while cleaning symtable
| * Fix symtable cache being used while cleaning symtableNikita Popov2021-02-151-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | We need to first clean the symtable and then check whether a cache slot is available for it. Otherwise, it may happen that a destructor runs while cleaning the table and uses up all the remaining slots in the cache. This is particularly insidious because once we overflow the cache, the first pointer we modify is symtable_cache_ptr, making it hard to understand what happened after the fact. Fixes oss-fuzz #30815.
* | Fix assertion failure in cufa optimization with named argsNikita Popov2021-02-151-0/+8
| | | | | | | | Fixes oss-fuzz#30764.
* | Don't throw additional Error in require_once if exception already thrownNikita Popov2021-02-111-0/+19
| | | | | | | | As pointed out in comments on bug #66216.
* | Improve switch continue warningNikita Popov2021-01-251-2/+19
| | | | | | | | | | Don't suggest "continue N+1" if there is no wrapping loop. The resulting code would be illegal.
* | Fixed bug #80596: Fix anonymous class union typehint errorsDaniil Gentili2021-01-141-0/+30
| | | | | | | | | | | | | | Cut off part after null byte when resolving the class name, to avoid cutting off a larger part lateron. Closes GH-6601.
* | Fix infinite recursion in unlinked_instanceofNikita Popov2021-01-051-0/+17
| | | | | | | | | | | | | | I suspect this is only a partial fix for the issue, it's probably possible to recurse through a more complex pathway as well. Fixes oss-fuzz #28961.
* | Don't use scope when validating AttributeNikita Popov2020-12-011-0/+9
| | | | | | | | | | | | | | This is not safe to do at this point. Even if we made it safe, we'd see inconsistencies due to a partially compiled class. Fixes oss-fuzz #28129.
* | Fixed bug #80404Nikita Popov2020-11-241-0/+11
| | | | | | | | | | | | | | | | | | | | For a division like [1..1]/[2..2] produce [0..1] as a result, which would be the integer envelope of the floating-point result. The implementation is pretty ugly (we're now taking min/max across eight values...) but I couldn't come up with a more elegant way to handle this that doesn't make things a lot more complex (the division sign handling is the annoying issue here).
* | Fixed bug #80391Nikita Popov2020-11-241-0/+23
| | | | | | | | | | Iterable was not considered a subtype of array|object, and thus also not a subtype of mixed.
* | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2020-11-181-0/+25
|\ \ | |/ | | | | | | * PHP-7.4: Short-circuit get_gc for currently running generator
| * Short-circuit get_gc for currently running generatorNikita Popov2020-11-181-0/+25
| |
* | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2020-11-171-0/+19
|\ \ | |/ | | | | | | * PHP-7.4: Fix incorrectly optimized out live range
| * Fix incorrectly optimized out live rangeNikita Popov2020-11-171-0/+19
| | | | | | | | | | | | | | For x ? y : z style structures, the live range starts at z, but may also hold the value of y. Make sure that the refcounting check takes this into account, by checking the type of a potential phi user.
* | Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2020-11-163-14/+14
|\ \ | |/ | | | | | | * PHP-7.4: Fix #74558: Can't rebind closure returned by Closure::fromCallable()
| * Fix #74558: Can't rebind closure returned by Closure::fromCallable()Christoph M. Becker2020-11-163-14/+14
| | | | | | | | | | | | | | | | Failure to rebind such closures is not necessarily related to them being created by `ReflectionFunctionAbstract::getClosure()`, so we fix the error message. Closes GH-6424.
* | 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.