Skip to content

Commit

Permalink
Merge pull request #1039 from microsoft/fix1014Only
Browse files Browse the repository at this point in the history
Emit `Unsafe.AsRef(in Value[0])`
  • Loading branch information
AArnott authored Sep 18, 2023
2 parents c11feb0 + 4e9fbe2 commit 6a5076f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Microsoft.Windows.CsWin32/Generator.InlineArrays.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ FixedStatementSyntax FixedBlock(SyntaxToken pointerLocalIdentifier, StatementSyn
nameColon: null,
TokenWithSpace(SyntaxKind.RefKeyword),
InvocationExpression(MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, IdentifierName(nameof(Unsafe)), IdentifierName(nameof(Unsafe.AsRef))))
.WithArgumentList(ArgumentList().AddArguments(Argument(value0))));
.WithArgumentList(ArgumentList().AddArguments(Argument(value0).WithRefKindKeyword(Token(SyntaxKind.InKeyword)))));

// MemoryMarshal.CreateReadOnlySpan(ref Unsafe.AsRef(Value[0]), Length)
InvocationExpressionSyntax createReadOnlySpanInvocation = InvocationExpression(MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, IdentifierName("MemoryMarshal"), IdentifierName("CreateReadOnlySpan")))
Expand Down

0 comments on commit 6a5076f

Please sign in to comment.