You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by st...@apache.org on 2013/11/06 19:03:50 UTC

svn commit: r1539412 - /perl/modperl/branches/httpd24threading/src/modules/perl/modperl_interp.h

Author: stevehay
Date: Wed Nov  6 18:03:50 2013
New Revision: 1539412

URL: http://svn.apache.org/r1539412
Log:
Make MP_INTERPa and MP_INTERP_POOLa more robust in the event of modperl_interp_select() returning NULL.

Modified:
    perl/modperl/branches/httpd24threading/src/modules/perl/modperl_interp.h

Modified: perl/modperl/branches/httpd24threading/src/modules/perl/modperl_interp.h
URL: http://svn.apache.org/viewvc/perl/modperl/branches/httpd24threading/src/modules/perl/modperl_interp.h?rev=1539412&r1=1539411&r2=1539412&view=diff
==============================================================================
--- perl/modperl/branches/httpd24threading/src/modules/perl/modperl_interp.h (original)
+++ perl/modperl/branches/httpd24threading/src/modules/perl/modperl_interp.h Wed Nov  6 18:03:50 2013
@@ -57,9 +57,15 @@ modperl_interp_t *modperl_interp_select(
     MP_TRACE_i(MP_FUNC, "selecting interp: r=%pp, c=%pp, s=%pp",        \
                (r), (c), (s));                                          \
     interp = modperl_interp_select((r), (c), (s));                      \
-    MP_TRACE_i(MP_FUNC, "  --> got (0x%pp)->refcnt=%d, perl=%pp",       \
-               interp, interp->refcnt, interp->perl);                   \
-    aTHX = interp->perl
+    if (interp) {                                                       \
+        MP_TRACE_i(MP_FUNC, "  --> got (0x%pp)->refcnt=%d, perl=%pp",   \
+                   interp, interp->refcnt, interp->perl);               \
+        aTHX = interp->perl;                                            \
+    }                                                                   \
+    else {                                                              \
+        MP_TRACE_i(MP_FUNC, "  --> failed");                            \
+    }                                                                   \
+    NOOP
 
 #define MP_dINTERPa(r, c, s)                                            \
     MP_dINTERP;                                                         \
@@ -68,9 +74,15 @@ modperl_interp_t *modperl_interp_select(
 #define MP_INTERP_POOLa(p, s)                                           \
     MP_TRACE_i(MP_FUNC, "selecting interp: p=%pp, s=%pp", (p), (s));    \
     interp = modperl_interp_pool_select((p), (s));                      \
-    MP_TRACE_i(MP_FUNC, "  --> got (0x%pp)->refcnt=%d",                 \
-               interp, interp->refcnt);                                 \
-    aTHX = interp->perl
+    if (interp) {                                                       \
+        MP_TRACE_i(MP_FUNC, "  --> got (0x%pp)->refcnt=%d",             \
+                   interp, interp->refcnt);                             \
+        aTHX = interp->perl;                                            \
+    }                                                                   \
+    else {                                                              \
+        MP_TRACE_i(MP_FUNC, "  --> failed");                            \
+    }                                                                   \
+    NOOP
 
 #define MP_dINTERP_POOLa(p, s)                                          \
     MP_dINTERP;                                                         \