Skip to content

Commit cea1c6c

Browse files
committed
ovmerge: Allow it to run on 32-bit Perls
Perl can be configured at build time to support 64-bit integers - ivsize=8 - even on 32-bit platforms. The Raspberry Pi Perl builds are configured this way but some aren't, causing interpreter errors on the 64-bit mask value 0xffffffffffffffff. Replacing this with a -1 has no negative effect when ivsize=8, and it allows the tool to run when ivsize=4 (without supporting values > 32-bit). See: #23 Signed-off-by: Phil Elwell <[email protected]>
1 parent 7451f17 commit cea1c6c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ovmerge/ovmerge

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1885,7 +1885,11 @@ sub get_labels
18851885
sub integer_value
18861886
{
18871887
my ($value, $size) = @_;
1888-
my %masks = (1=>0xff, 2=>0xffff, 4=>0xffffffff, 8=>0xffffffffffffffff);
1888+
# The following line should say '8=>0xffffffffffffffff', but this upsets
1889+
# builds of Perl with ivsize=4. This won't give the correct result for
1890+
# large values but Perl will already have rejected them due to integer
1891+
# overflow.
1892+
my %masks = (1=>0xff, 2=>0xffff, 4=>0xffffffff, 8=>-1);
18891893
return undef if (!defined $value);
18901894
if ($value =~ /^(y|yes|on|true|down)?$/)
18911895
{

0 commit comments

Comments
 (0)