• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SamboyCoding / Cpp2IL / 24971814523

27 Apr 2026 01:07AM UTC coverage: 35.136% (-0.2%) from 35.366%
24971814523

Pull #542

github

web-flow
Merge 32624b1f2 into ed90670ff
Pull Request #542: Remove static mutable state from LibCpp2IL 2: Electric Boogaloo

1871 of 6663 branches covered (28.08%)

Branch coverage included in aggregate %.

303 of 568 new or added lines in 66 files covered. (53.35%)

12 existing lines in 11 files now uncovered.

4387 of 11148 relevant lines covered (39.35%)

268964.17 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/Cpp2IL.Core/Model/Contexts/NativeMethodAnalysisContext.cs
1
using System;
2
using System.Reflection;
3

4
namespace Cpp2IL.Core.Model.Contexts;
5

6
public sealed class NativeMethodAnalysisContext : MethodAnalysisContext
7
{
8
    public override ulong UnderlyingPointer { get; }
×
9

10
    public override string DefaultName { get; }
×
11

12
    protected override bool IsInjected => true;
×
13

14
    public override TypeAnalysisContext DefaultReturnType => isVoid ? AppContext.SystemTypes.SystemVoidType : AppContext.SystemTypes.SystemObjectType;
×
15

16
    public override MethodAttributes DefaultAttributes => MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.HideBySig;
×
17

18
    public override MethodImplAttributes DefaultImplAttributes => MethodImplAttributes.Managed;
×
19

20
    protected override int CustomAttributeIndex => -1;
×
21

22
    private readonly bool isVoid;
23

24
    public NativeMethodAnalysisContext(TypeAnalysisContext parent, ulong address, bool voidReturn) : base(null, parent)
×
25
    {
26
        if (address == 0)
×
27
            throw new ArgumentOutOfRangeException(nameof(address));
×
28

29
        isVoid = voidReturn;
×
30
        UnderlyingPointer = address;
×
NEW
31
        if (AppContext.Binary.TryGetExportedFunctionName(UnderlyingPointer, out var name))
×
32
        {
33
            DefaultName = name;
×
34
        }
35
        else
36
        {
37
            DefaultName = $"NativeMethod_0x{UnderlyingPointer:X}";
×
38
        }
39

40
        rawMethodBody = AppContext.InstructionSet.GetRawBytesForMethod(this, false);
×
41
    }
×
42
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc