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

SamboyCoding / Cpp2IL / 24214080939

09 Apr 2026 09:24PM UTC coverage: 35.264% (-0.1%) from 35.373%
24214080939

Pull #542

github

web-flow
Merge 0799babd3 into 25552e0ff
Pull Request #542: Remove static mutable state from LibCpp2IL 2: Electric Boogaloo

1914 of 6805 branches covered (28.13%)

Branch coverage included in aggregate %.

255 of 483 new or added lines in 62 files covered. (52.8%)

46 existing lines in 8 files now uncovered.

4480 of 11327 relevant lines covered (39.55%)

263053.76 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