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: 2010-12-14 12:37 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:
Status: Open Package: Scripting Engine problem
PHP Version: 5.3.1 OS: Vista64-cygwin
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Sep 21 19:01:26 2019 UTC