mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-22 08:26:35 +01:00
perl: make error messages compatible with XS
This commit is contained in:
parent
c320e44a23
commit
f1c294ca50
@ -305,10 +305,10 @@ foreach my $pair(
|
||||
sub _unpack {
|
||||
my ( $value ) = @_;
|
||||
# get a header byte
|
||||
my $byte = unpack "x$p C", $value; # "x$p" is faster than substr()
|
||||
defined(my $byte = unpack "x$p C", $value)
|
||||
or Carp::confess("Data::MessagePack->unpack: insufficient bytes");
|
||||
$p++;
|
||||
|
||||
Carp::croak("invalid data") unless defined $byte;
|
||||
|
||||
# +/- fixnum, nil, true, false
|
||||
return $byte2value[$byte] if $typemap[$byte] & $T_DIRECT;
|
||||
|
Loading…
x
Reference in New Issue
Block a user