SVs with POK and IOK/NOK should be packed as numbers, not strings

This commit is contained in:
Fuji, Goro
2011-08-07 18:36:50 +09:00
parent 800a93a859
commit 28f4338a6c
3 changed files with 38 additions and 18 deletions

View File

@@ -211,6 +211,9 @@ sub _pack {
}
}
elsif ( $flags & ( B::SVf_NOK | B::SVp_NOK ) ) { # double only
return pack_double( $value );
}
elsif ( $flags & B::SVf_POK ) { # raw / check needs before dboule
if ( $Data::MessagePack::PreferInteger ) {
@@ -242,9 +245,6 @@ sub _pack {
return $header . $value;
}
elsif ( $flags & ( B::SVf_NOK | B::SVp_NOK ) ) { # double only
return pack_double( $value );
}
else {
_unexpected("data type %s", $b_obj);
}