Cosmos
Cosmos copied to clipboard
Isr for division by zero not firing
Area of Cosmos - What area of Cosmos are we dealing with?
Interrupts
Expected Behaviour - What do you think that should happen?
Exception by zero should throw a CPU panic
Actual Behaviour - What unexpectedly happens?
Cosmos totally ignores it and actually prints out 0 in writeline
Reproduction - How did you get this error to appear?
Try something like int a = 0/0; Console.WriteLine(a);
Version - Were you using the User Kit or Dev Kit? And what User Kit version or Dev Kit commit (Cosmos, IL2CPU, X#)? Dev kit branch vs2022
The correct behavior should be that a DivideByZeroException (https://docs.microsoft.com/en-us/dotnet/api/system.dividebyzeroexception?view=net-6.0) is raised. This is currently happening. The issue seems to be with the following code https://github.com/CosmosOS/IL2CPU/blob/master/source/Cosmos.IL2CPU/IL/Div.cs#L178-L185