From: Jarkko Hietaniemi Date: Tue, 5 Aug 2003 05:29:11 +0000 (+0000) Subject: Bytecode patching from Enache. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a243a48e99fa6345b1c8b09f3d98952fb43ec4a5;p=p5sagit%2Fp5-mst-13.2.git Bytecode patching from Enache. p4raw-id: //depot/perl@20485 --- diff --git a/ext/B/B/Assembler.pm b/ext/B/B/Assembler.pm index 218a6e7..31a8e92 100644 --- a/ext/B/B/Assembler.pm +++ b/ext/B/B/Assembler.pm @@ -181,8 +181,6 @@ sub gen_header { $header .= B::Asmdata::PUT_strconst(qq["$ByteLoader::VERSION"]); $header .= B::Asmdata::PUT_U32($Config{ivsize}); $header .= B::Asmdata::PUT_U32($Config{ptrsize}); - $header .= B::Asmdata::PUT_strconst(sprintf(qq["0x%s"], $Config{byteorder})); - $header; } diff --git a/ext/B/B/Disassembler.pm b/ext/B/B/Disassembler.pm index fc115d4..65e2f40 100644 --- a/ext/B/B/Disassembler.pm +++ b/ext/B/B/Disassembler.pm @@ -162,7 +162,7 @@ use strict; use B::Asmdata qw(%insn_data @insn_name); -our( $magic, $archname, $blversion, $ivsize, $ptrsize, $byteorder ); +our( $magic, $archname, $blversion, $ivsize, $ptrsize ); sub dis_header($){ my( $fh ) = @_; @@ -172,11 +172,10 @@ sub dis_header($){ $blversion = $fh->GET_strconst(); $ivsize = $fh->GET_U32(); $ptrsize = $fh->GET_U32(); - $byteorder = $fh->GET_strconst(); } sub get_header(){ - return( $magic, $archname, $blversion, $ivsize, $ptrsize, $byteorder ); + return( $magic, $archname, $blversion, $ivsize, $ptrsize); } sub disassemble_fh { diff --git a/ext/B/t/bytecode.t b/ext/B/t/bytecode.t index 47bae92..e8f7d6b 100644 --- a/ext/B/t/bytecode.t +++ b/ext/B/t/bytecode.t @@ -7,6 +7,11 @@ BEGIN { } chdir 't' if -d 't'; @INC = qw(../lib); + use Config; + if ($Config{ccflags} =~ /-DPERL_COPY_ON_WRITE/) { + print "1..0 # skip - no COW for now\n"; + exit 0; + } require './test.pl'; # for run_perl() } use strict; @@ -104,10 +109,6 @@ my $i = 1; my $foo = sub {$i = shift if @_}; &$foo(3); ############################################################ -$_="\xff\xff"; use utf8; utf8::encode $_; print $_ ->>>> -\xc3\xbf\xc3\xbf -############################################################ $x="Cannot use"; print index $x, "Can" >>>> 0 diff --git a/ext/ByteLoader/bytecode.h b/ext/ByteLoader/bytecode.h index 165e67a..a9de88f 100644 --- a/ext/ByteLoader/bytecode.h +++ b/ext/ByteLoader/bytecode.h @@ -370,8 +370,4 @@ typedef char *pvindex; if (sz != PTRSIZE) { \ HEADER_FAIL("different PTRSIZE"); \ } \ - BGET_strconst(str); /* byteorder */ \ - if (strNE(str, STRINGIFY(BYTEORDER))) { \ - HEADER_FAIL("different byteorder"); \ - } \ } STMT_END diff --git a/t/TEST b/t/TEST index 3e6e408..c42d10a 100755 --- a/t/TEST +++ b/t/TEST @@ -256,7 +256,7 @@ EOT my $bytecompile = "$perl $testswitch $switch -I../lib $bswitch". "-o$test.plc $test 2>/dev/null &&". - "$perl $testswitch $switch $utf $test.plc $redir|"; + "$perl $testswitch $switch -I../lib $utf $test.plc $redir|"; open(RESULTS,$bytecompile) or print "can't byte-compile '$bytecompile': $!.\n"; }