develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r35841 - trunk/lib/Parrot/OpTrans

From:
chromatic
Date:
January 20, 2009 15:00
Subject:
[svn:parrot] r35841 - trunk/lib/Parrot/OpTrans
Message ID:
20090120225953.AB85CCB9AE@x12.develooper.com
Author: chromatic
Date: Tue Jan 20 14:59:52 2009
New Revision: 35841

Modified:
   trunk/lib/Parrot/OpTrans/CSwitch.pm

Log:
[runcore] Fixed the Switch core (-S) by initializing the op function table
element of the core struct before Parrot attempts to dereference it.  Don't ask
me when this broke or why, or even what this means.  make testS now passes
though.

Modified: trunk/lib/Parrot/OpTrans/CSwitch.pm
==============================================================================
--- trunk/lib/Parrot/OpTrans/CSwitch.pm	(original)
+++ trunk/lib/Parrot/OpTrans/CSwitch.pm	Tue Jan 20 14:59:52 2009
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2008, The Perl Foundation.
+# Copyright (C) 2001-2009, The Perl Foundation.
 # $Id$
 
 =head1 NAME
@@ -131,6 +131,24 @@
               goto SWITCH_AGAIN; }";
 }
 
+=item C<init_func_init1($base)>
+
+Returns the C code for the init function.
+
+=cut
+
+sub init_func_init1 {
+    my ( $self, $base ) = @_;
+    my $cg_func = $self->core_prefix . $base;
+    my $bs      = $base . $self->suffix . '_';
+
+    return <<END_C;
+        if (!${bs}op_lib.op_func_table)
+            ${bs}op_lib.op_func_table = (op_func_t *)&core_switch_op_lib;
+END_C
+}
+
+
 =item C<run_core_func_start()>
 
 Returns the C code prior to the run core function.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About