From: Jarkko Hietaniemi Date: Fri, 21 Dec 2001 13:42:31 +0000 (+0000) Subject: packing I32 with L is not nice, need l; from Wolfgang Laun. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e53790c1de51b5453ccdee177a995225bf5154c2;p=p5sagit%2Fp5-mst-13.2.git packing I32 with L is not nice, need l; from Wolfgang Laun. p4raw-id: //depot/perl@13830 --- diff --git a/ext/B/B/Assembler.pm b/ext/B/B/Assembler.pm index 4db23f1..429405f 100644 --- a/ext/B/B/Assembler.pm +++ b/ext/B/B/Assembler.pm @@ -72,7 +72,7 @@ sub B::Asmdata::PUT_U32 { } sub B::Asmdata::PUT_I32 { my $arg = limcheck( $_[0], -0x80000000, 0x7fffffff, 'I32' ); - pack("L", $arg); + pack("l", $arg); } sub B::Asmdata::PUT_NV { sprintf("%s\0", $_[0]) } # "%lf" looses precision and pack('d',...) # may not even be portable between compilers diff --git a/ext/B/B/Disassembler.pm b/ext/B/B/Disassembler.pm index b8b5262..a50b48f 100644 --- a/ext/B/B/Disassembler.pm +++ b/ext/B/B/Disassembler.pm @@ -56,7 +56,7 @@ sub GET_I32 { my $fh = shift; my $str = $fh->readn(4); croak "reached EOF while reading I32" unless length($str) == 4; - return cast_I32(unpack("L", $str)); + return unpack("l", $str); } sub GET_objindex { diff --git a/ext/B/t/assembler.t b/ext/B/t/assembler.t index 6bec7e0..3e987e0 100644 --- a/ext/B/t/assembler.t +++ b/ext/B/t/assembler.t @@ -197,7 +197,7 @@ sub putdis(@){ # sub gen_type($$$){ my( $href, $descref, $text ) = @_; - for my $odt ( keys( %opsByType ) ){ + for my $odt ( sort( keys( %opsByType ) ) ){ my $opcode = $opsByType{$odt}->[0]; my $sel = $odt; $sel =~ s/^GET_//;