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

SamboyCoding / Cpp2IL / 25641285720

10 May 2026 10:18PM UTC coverage: 35.104% (-0.2%) from 35.33%
25641285720

Pull #542

github

web-flow
Merge 9249bcb5b into 6af99f218
Pull Request #542: Remove static mutable state from LibCpp2IL 2: Electric Boogaloo

1877 of 6693 branches covered (28.04%)

Branch coverage included in aggregate %.

303 of 569 new or added lines in 66 files covered. (53.25%)

12 existing lines in 11 files now uncovered.

4394 of 11171 relevant lines covered (39.33%)

268486.35 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