When I try to process the next code void a(){} with command line arguments -cs input.cs output.asm output.il I have the next error in the output.il file
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at PowerUp.Watcher.ILWriter.ToILString(DecompilationUnit unit) in E:\tools\PowerUp-main\src\PowerUp.Watcher\ILWriter.cs:line 100
at PowerUp.Watcher.CSharpWatcher.ToILString(DecompilationUnit unit) in E:\tools\PowerUp-main\src\PowerUp.Watcher\CSharpWatcher.cs:line 319
at PowerUp.Watcher.CSharpWatcher.TryWriteIL(DecompilationUnit unit, String& result) in E:\tools\PowerUp-main\src\PowerUp.Watcher\CSharpWatcher.cs:line 269
I managed to fix it by changing the line ILWriter.cs#L20 to the next one
var lines = unit.InputSouceCode.Replace("\r", string.Empty).Split('\n');
And I got the next result in the output.il
.class public auto ansi beforefieldinit CompilerGen
extends [System.Private.CoreLib]System.Object
{
.method private hidebysig
instance void a () cil managed
{
.maxstack 8
// void a(){}
IL_0000: ret
}
.method public hidebysig specialname rtspecialname
instance void .ctor () cil managed
{
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [System.Private.CoreLib]System.Object::.ctor()
IL_0006: ret
}
}
Please, confirm that my change is okay and I'll create a PR. Or if I did something wrong, please let me know.
I use version from 16afbe9e05b7972cffa611ab2f5c267d624211cc commit with net 5 and Windows.
When I try to process the next code
void a(){}
with command line arguments-cs input.cs output.asm output.il
I have the next error in the output.il fileI managed to fix it by changing the line ILWriter.cs#L20 to the next one
And I got the next result in the output.il
Please, confirm that my change is okay and I'll create a PR. Or if I did something wrong, please let me know.
I use version from 16afbe9e05b7972cffa611ab2f5c267d624211cc commit with net 5 and Windows.