Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix not excluded branchpoints in async state machine #1745

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Documentation/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased

### Fixed
- use `<TargetFramework>netstandard2.0</TargetFramework>` for _coverlet.collector_ and _coverlet.msbuild.tasks_ Packages´
- Fix branchpoint exclusion for sdk 8.0.407 [#1741](https://github.com/coverlet-coverage/coverlet/issues/1741)
- Use `<TargetFramework>netstandard2.0</TargetFramework>` for _coverlet.collector_ and _coverlet.msbuild.tasks_ Packages´

### Improvements
- use [xunit.v3](https://xunit.net/docs/getting-started/v3/whats-new) for tests and example code
- Use [xunit.v3](https://xunit.net/docs/getting-started/v3/whats-new) for tests and example code


## Release date 2024-01-20
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "8.0.113"
"version": "8.0.407"
}
}
5 changes: 3 additions & 2 deletions src/coverlet.core/Symbols/CecilSymbolHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Coverlet.Core.Abstractions;
using Coverlet.Core.Extensions;

Expand Down Expand Up @@ -733,7 +734,7 @@ static bool CheckForSkipDisposal(List<Instruction> instructions, Instruction ins
field.Equals(reloadedField) &&
instructions[i + 1].OpCode == OpCodes.Callvirt &&
instructions[i + 1].Operand is MethodReference method &&
method.DeclaringType.FullName == "System.IAsyncDisposable" &&
method.ReturnType.FullName == typeof(ValueTask).FullName &&
method.Name == "DisposeAsync")
{
isFollowedByDisposeAsync = true;
Expand All @@ -755,7 +756,7 @@ static bool CheckForSkipDisposal(List<Instruction> instructions, Instruction ins
instructions[currentIndex - 1].OpCode == OpCodes.Ldloc_3) &&
instructions[currentIndex + 2].OpCode == OpCodes.Callvirt &&
instructions[currentIndex + 2].Operand is MethodReference method &&
method.DeclaringType.FullName == "System.IAsyncDisposable" &&
method.ReturnType.FullName == typeof(ValueTask).FullName &&
method.Name == "DisposeAsync")
{
isFollowedByDisposeAsync = true;
Expand Down