php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #50844 misbehaviour of zend_ts_hash_apply_with_arguments
Submitted: 2010-01-26 10:27 UTC Modified: 2021-08-22 04:48 UTC
Votes:3
Avg. Score:3.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: Martin dot Eisengardt at fiducia dot de Assigned: krakjoe (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3.1 OS: Vista64-cygwin
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: Martin dot Eisengardt at fiducia dot de
New email:
PHP Version: OS:

 

 [2010-01-26 10:27 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-14 12:37 UTC] jani@php.net
-Package: Feature/Change Request +Package: Scripting Engine problem
 [2020-03-01 22:41 UTC] cmb@php.net
-Assigned To: +Assigned To: krakjoe
 [2020-03-01 22:41 UTC] cmb@php.net
It might be more sensible to drop TsHashTable instead.
 [2021-08-22 04:48 UTC] krakjoe@php.net
-Status: Assigned +Status: Closed
 [2021-08-22 04:48 UTC] krakjoe@php.net
No longer applicable, TsHashTable was dropped.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 09:01:26 2024 UTC