• 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/Graphs/Processors/MetadataProcessor.cs
1
using Cpp2IL.Core.ISIL;
2
using Cpp2IL.Core.Model.Contexts;
3
using Cpp2IL.Core.Utils;
4

5
namespace Cpp2IL.Core.Graphs.Processors;
6

7
internal class MetadataProcessor : IBlockProcessor
8
{
9
    public void Process(MethodAnalysisContext methodAnalysisContext, Block block)
10
    {
11
        foreach (var instruction in block.isilInstructions)
×
12
        {
13
            // TODO: Check if it shows up in any other
14
            if (instruction.OpCode != InstructionSetIndependentOpCode.Move)
×
15
            {
16
                continue;
17
            }
18

19
            if (instruction.Operands[0].Type != InstructionSetIndependentOperand.OperandType.Register || instruction.Operands[1].Type != InstructionSetIndependentOperand.OperandType.Memory)
×
20
            {
21
                continue;
22
            }
23

24
            var memoryOp = (IsilMemoryOperand)instruction.Operands[1].Data;
×
25
            if (memoryOp.Base == null && memoryOp.Index == null && memoryOp.Scale == 0)
×
26
            {
NEW
27
                var val = methodAnalysisContext.AppContext.LibCpp2IlContext.GetLiteralByAddress((ulong)memoryOp.Addend);
×
28
                if (val == null)
×
29
                {
30
                    // Try instead check if its type metadata usage
NEW
31
                    var metadataUsage = methodAnalysisContext.AppContext.LibCpp2IlContext.GetTypeGlobalByAddress((ulong)memoryOp.Addend);
×
32
                    if (metadataUsage != null && methodAnalysisContext.DeclaringType is not null)
×
33
                    {
34
                        var typeAnalysisContext = metadataUsage.ToContext(methodAnalysisContext.DeclaringType!.DeclaringAssembly);
×
35
                        if (typeAnalysisContext != null)
×
36
                            instruction.Operands[1] = InstructionSetIndependentOperand.MakeTypeMetadataUsage(typeAnalysisContext);
×
37
                    }
38

39
                    continue;
×
40
                }
41

42
                instruction.Operands[1] = InstructionSetIndependentOperand.MakeImmediate(val);
×
43
            }
44
        }
45
    }
×
46
}
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