]> granicus.if.org Git - php/commitdiff
gen_stub: Don't use $aliasMap during verification
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 18 Jan 2021 15:01:16 +0000 (16:01 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 18 Jan 2021 15:04:14 +0000 (16:04 +0100)
Some functions have multiple aliases, while the $aliasMap can
only record one.

Methodsynopsis generation probably shouldn't use it either, but
at least that case seems to only be interested in whether there
is an alias at all.

build/gen_stub.php
ext/standard/basic_functions_arginfo.h

index ee19f57a0cae4c03bcac0076d8f0dfaa5e0079a4..f231307f2aa9ae91280d8ec4b9f1b9d6cdaec80e 100755 (executable)
@@ -1870,6 +1870,7 @@ foreach ($fileInfos as $fileInfo) {
         /** @var FuncInfo $funcInfo */
         $funcMap[$funcInfo->name->__toString()] = $funcInfo;
 
+        // TODO: Don't use aliasMap for methodsynopsis?
         if ($funcInfo->aliasType === "alias") {
             $aliasMap[$funcInfo->alias->__toString()] = $funcInfo;
         }
@@ -1879,7 +1880,11 @@ foreach ($fileInfos as $fileInfo) {
 if ($verify) {
     $errors = [];
 
-    foreach ($aliasMap as $aliasFunc) {
+    foreach ($funcMap as $aliasFunc) {
+        if ($aliasFunc->aliasType !== "alias") {
+            continue;
+        }
+
         if (!isset($funcMap[$aliasFunc->alias->__toString()])) {
             $errors[] = "Aliased function {$aliasFunc->alias}() cannot be found";
             continue;
index 1b72949a5475bbb88f285f05ea8af017623b04b8..e416fc5e272bb2e1abd3a25a6bb0e97809f094d9 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 21e54280829776de72313b96e38ad2aee60bd0ee */
+ * Stub hash: 4e471966d507762dd6fdd2fc4200c8430fac97f4 */
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0)
        ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0)