perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject svn commit: r1733564 - /perl/modperl/trunk/xs/Apache2/RequestIO/Apache2__RequestIO.h
Date Fri, 04 Mar 2016 08:29:00 GMT
Author: stevehay
Date: Fri Mar  4 08:29:00 2016
New Revision: 1733564

Fix printf tests for perl-5.22 without ithreads support

The comment in r1702395 is wrong. It's not because of the thread context that the number of
arguments is wrong, it's because of the way handles functions with variable parameter
length (i.e. ... functions).

In the .xs code items is the number of elements in the MARK array. However when
generates code for a ... function, it will increment MARK, so that it points to the second
argument to the function. It will not, however decrement items, which means that items and
MARK now are out of sync. We suspect that MARK is incremented to skip the object that the
function is called on.

This patch updates the comment and removes the ifdef around the decrementation of items, which
solves the test failures for non-threaded perl 5.22.

Thanks to Klaus S. Madsen <> for the patch.


Modified: perl/modperl/trunk/xs/Apache2/RequestIO/Apache2__RequestIO.h
--- perl/modperl/trunk/xs/Apache2/RequestIO/Apache2__RequestIO.h (original)
+++ perl/modperl/trunk/xs/Apache2/RequestIO/Apache2__RequestIO.h Fri Mar  4 08:29:00 2016
@@ -111,13 +111,11 @@ apr_size_t mpxs_ap_rprintf(pTHX_ I32 ite
     rcfg = modperl_config_req_get(r);
-    /* Reduce items by 1 for threaded builds since it otherwise includes
-     * the thread context, which shouldn't be included in the count of
-     * arguments being given to the sprintf() call.
+    /* Reduce items by 1 since it otherwise includes the
+     * Apache2::RequestRec object, which shouldn't be included in the
+     * count of arguments being given to the sprintf() call.
     /* XXX: we could have an rcfg->sprintf_buffer to reuse this SV
      * across requests

View raw message