[svn:mod_parrot] r627 - mod_parrot/trunk/lib/ModParrot/APR

[email protected] Tue, 21 Apr 2009 09:15:15 -0700 (PDT)
Newsgroups perl.cvs.mod_parrot
Message-ID <[email protected]>
Author: jhorwitz
Date: Tue Apr 21 09:15:13 2009
New Revision: 627

Modified:
   mod_parrot/trunk/lib/ModParrot/APR/Pool.pir

Log:
fix badness when passing null PMC as a double-pointer via NCI.  it reassigned
PMCNULL to the pool struct, which is bad.


Modified: mod_parrot/trunk/lib/ModParrot/APR/Pool.pir
==============================================================================
--- mod_parrot/trunk/lib/ModParrot/APR/Pool.pir	(original)
+++ mod_parrot/trunk/lib/ModParrot/APR/Pool.pir	Tue Apr 21 09:15:13 2009
@@ -74,8 +74,10 @@
     apr_pool_create = get_root_global [ 'APR'; 'NCI' ], "apr_pool_create_ex"
     null_ptr = get_root_global [ 'ModParrot'; 'NCI' ], "null"
     nul = null_ptr()
+    pool = new 'CPointer'
     $I0 = apr_pool_create(pool, nul, nul, nul)
     setattribute self, 'apr_pool', pool
+  no_self:
 .end
 
 .sub init_pmc :vtable :method
@@ -101,7 +103,7 @@
     # XXX should never get here, else we'd be in init()
     goto done
   have_parent:
-    null pool
+    pool = new 'CPointer'
     $P0 = getattribute parent_attr, 'apr_pool'
     $I0 = apr_pool_create(pool, $P0, nul, nul)
     setattribute self, 'apr_pool', pool