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.