Skip to content

ILVerify fails assemblies that use Span<T> and stackalloc #89691

Closed
@defufna

Description

@defufna

Description

Following code fails ILVerify verification:

Span<byte> buffer = stackalloc byte[16];

It fails with "Instruction cannot be verified.", but stackalloc with Span should be safe?

Reproduction Steps

  1. Build a dll that contains mentioned code.
  2. Run ILVerify on it

Expected behavior

Code passes verification

Actual behavior

Code fails verification with "Instruction cannot be verified." message.

Regression?

This is not a regression...

Known Workarounds

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Labels

Priority:3Work that is nice to havearea-Tools-ILVerificationIssues related to ilverify tool and IL verification in general

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions