Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/Cosmos.IL2CPU/ILOpCodes/OpNone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ public override void DoInterpretStackTypes()
{
throw new Exception("Wrong value type: " + StackPopTypes[0].FullName);
}
if (!ILOp.IsPointer(StackPopTypes[1]) && StackPopTypes[1] != typeof(int))
if (!ILOp.IsPointer(StackPopTypes[1]) && StackPopTypes[1] != typeof(long) && StackPopTypes[1] != typeof(int))
{
throw new Exception("Wrong Pointer type: " + StackPopTypes[1].FullName);
}
Expand Down
10 changes: 8 additions & 2 deletions source/Cosmos.IL2CPU/MethodAnalysis/ILGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,17 @@ public static List<ILGroup> GenerateGroups(ILMethod aMethod, DebugInfo.SequenceP
}

// Initialse the datastructure with the first opcode

var list = aMethod.Code.Select(c => c.Value.Position).ToList();
// Analyse op codes
foreach (var (_, opGroup) in groups)
foreach (var (val, opGroup) in groups)
{

while (true)
{
var analysing = opGroup.OpCodes.Last();

list.Remove(analysing.Position);

analysed++;

var done = true;
Expand Down Expand Up @@ -120,6 +123,9 @@ public static List<ILGroup> GenerateGroups(ILMethod aMethod, DebugInfo.SequenceP
}
}

aMethod.Code = aMethod.Code.Where(c => !list.Contains(c.Key)).ToDictionary(i => i.Key, i => i.Value);
aMethod.Length = aMethod.Code.Count;

if(analysed != aMethod.Length)
{
throw new Exception("GenerateGroups --- Did not reach all instructions in method");
Expand Down