Skip to content

Commit

Permalink
Trying to allow .address.cast() expr in leaf calls
Browse files Browse the repository at this point in the history
this is requested here dart-lang#55971
  • Loading branch information
codesculpture committed Jul 31, 2024
1 parent 95f5efc commit 307e449
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/vm/lib/modular/transformations/ffi/use_sites.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1510,6 +1510,10 @@ mixin _FfiUseSiteTransformer on FfiTransformer {
return ('', parameterType, argument);
}

if(argument is InstanceInvocation && argument.name.text == "cast" && argument.functionType.returnType == parameterType ) {
final subExpression = argument.receiver;
return _replaceNativeCallParameterAndArgument(parameter, parameterType, subExpression, fileOffset);
}
if (argument is! StaticInvocation ||
!addressOfMethods.contains(argument.target)) {
// The argument has type Pointer, but it's not produced by any of the
Expand Down

0 comments on commit 307e449

Please sign in to comment.