CosmosOS / IL2CPU

IL2CPU is a compiler for .NET IL code to compile to assembly language for direct booting.
BSD 3-Clause "New" or "Revised" License
282 stars 70 forks source link

64-bit division improvements #54

Closed jp2masa closed 6 years ago

jp2masa commented 6 years ago

Changes

Cosmos CI build: https://ci.appveyor.com/project/CosmosOS/cosmos/build/0.20150918.2027

mterwoord commented 6 years ago

@jp2masa @fanoI What's the conclusion for the remark on division by 0?

jp2masa commented 6 years ago

The purpose of these fixes is mainly to unblock DateTime and TimeSpan, and I think we never checked division by 0, but I can add that if you think it's relevant.

fanoI commented 6 years ago

Yes Int32 division is does not checking for 0 too: https://github.com/CosmosOS/IL2CPU/blob/master/source/Cosmos.IL2CPU/IL/Div.cs#L135.

I think it will be more "compliant" to do this check for Int32 and Int64 too.