Skip to content

Commit

Permalink
FFI::Probe: fix complex float detection
Browse files Browse the repository at this point in the history
`!!$type =~ /complex/` never matches because it is parsed as `(!!$type) =~ /complex/`. Fix the logic by adding parentheses in the right place.
  • Loading branch information
mauke authored and plicease committed Aug 19, 2024
1 parent 81d8c69 commit cef9e64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/FFI/Probe.pm
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ sub check_type_float
return unless $ret;

my $size = $self->data->{type}->{$type}->{size};
my $complex = !!$type =~ /complex/;
my $complex = !!($type =~ /complex/);

if($complex) {
$size /= 2;
Expand Down

0 comments on commit cef9e64

Please sign in to comment.