• 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/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