PerlFFI / FFI-Platypus

Write Perl bindings to non-Perl libraries with FFI. No XS required.
89 stars 23 forks source link

uint64 being returned as sint64 #258

Closed plicease closed 4 years ago

plicease commented 4 years ago

I am not seeing similar behavior for uint32 or for casting so I think this is a FFI::C bug, not related to Platypus.

helix% perl -MFFI::Platypus -MFFI::C -E 'package Foo { FFI::C->struct([x=>"uint64"]) }; my $foo = Foo->new({ x => 0xffffffffffffffff }); say $foo->x'
-1
helix% perl -MFFI::Platypus -E 'say FFI::Platypus->new(api => 1)->cast("uint64","uint64",0xffffffffffffffff)'
18446744073709551615
plicease commented 4 years ago

Wrong! Looks like a bug in FFI-Platypus pointer to uint64 type.