mirror of
https://git.proxmox.com/git/perlmod
synced 2025-10-04 23:28:05 +00:00
allow PVMG in deserialization
they are supposed to end up being regular scalars after all, usually Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
1bb53e8403
commit
db22bf8db6
@ -193,18 +193,13 @@ impl ScalarRef {
|
|||||||
Type::Reference
|
Type::Reference
|
||||||
} else {
|
} else {
|
||||||
let flags = ffi::RSPL_type_flags(self.sv());
|
let flags = ffi::RSPL_type_flags(self.sv());
|
||||||
if flags > 0xff {
|
if ffi::RSPL_is_array(self.sv()) {
|
||||||
// we may possibly get here via a `#[raw]` scalar reference (though not
|
|
||||||
// really?)
|
|
||||||
Type::Other(0)
|
|
||||||
//panic!("bad C type returned");
|
|
||||||
} else if flags != 0 {
|
|
||||||
// non-scalars will not have any flags:
|
|
||||||
Type::Scalar(Flags::from_bits(flags as u8).unwrap())
|
|
||||||
} else if ffi::RSPL_is_array(self.sv()) {
|
|
||||||
Type::Array
|
Type::Array
|
||||||
} else if ffi::RSPL_is_hash(self.sv()) {
|
} else if ffi::RSPL_is_hash(self.sv()) {
|
||||||
Type::Hash
|
Type::Hash
|
||||||
|
} else if flags != 0 {
|
||||||
|
// non-scalars will not have any flags:
|
||||||
|
Type::Scalar(Flags::from_bits_truncate(flags as u8))
|
||||||
} else {
|
} else {
|
||||||
// but `undef` also has no flags, so:
|
// but `undef` also has no flags, so:
|
||||||
let ty = ffi::RSPL_svtype(self.sv());
|
let ty = ffi::RSPL_svtype(self.sv());
|
||||||
|
Loading…
Reference in New Issue
Block a user