Req #50844 [Asn->Csd]: misbehaviour of zend_ts_hash_apply_with_arguments

From: Date: Sun, 22 Aug 2021 04:48:44 +0000
Subject: Req #50844 [Asn->Csd]: misbehaviour of zend_ts_hash_apply_with_arguments
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-236010@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=50844&edit=1

 ID:                 50844
 Updated by:         krakjoe@php.net
 Reported by:        Martin dot Eisengardt at fiducia dot de
 Summary:            misbehaviour of zend_ts_hash_apply_with_arguments
-Status:             Assigned
+Status:             Closed
 Type:               Feature/Change Request
 Package:            Scripting Engine problem
 Operating System:   Vista64-cygwin
 PHP Version:        5.3.1
 Assigned To:        krakjoe
 Block user comment: N
 Private report:     N

 New Comment:

No longer applicable, TsHashTable was dropped.


Previous Comments:
------------------------------------------------------------------------
[2020-03-01 22:41:53] cmb@php.net

It might be more sensible to drop TsHashTable instead.

------------------------------------------------------------------------
[2010-01-26 10:27:16] Martin dot Eisengardt at fiducia dot de

Description:
------------
I was using a TsHashTable in my extension and assumed that it behaves the same as normal HashTable.
It is almost the same except function zend_ts_hash_apply_with_arguments.

Reproduce code:
---------------
function applyFunc(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
{
    int myint = va_arg(args, int);
    // myint will contain the wrong integer. Hoever the following code will work
    // va_list args2 = va_arg(args2, va_list);
    // int myint = va_arg(args2, int);
}


zend_ts_hash_apply_with_arguments(ht TSRMLS_CC, applyFunc, 1, myInt);

Expected result:
----------------
Expected that there is no need to extract args2 before extracting the actual argument. In other
word: Expected to use the same applyFunc for both, TsHashTable and HashTable

Actual result:
--------------
You need to extract another va_list first before extracting the arguments


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=50844&edit=1


Thread (3 messages)

« previous php.bugs (#236010) next »