renan-guimaraes / dwscript

Automatically exported from code.google.com/p/dwscript
0 stars 0 forks source link

Jitted code don't raising exception #373

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Code:

var x := 0;
var y := 1 / x;

print('OK');

Output with JIT:

OK

Output without JIT:

Runtime Error: Floating point division by zero

Original issue reported on code.google.com by kazantse...@mail.ru on 20 Apr 2013 at 9:56

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1957.

Original comment by zar...@gmail.com on 22 Apr 2013 at 1:06

GoogleCodeExporter commented 9 years ago
Since JIT uses SSE2, you have to adjust the MXCSR to mask/unmask exceptions 
(similar to 8087CW for the FPU)

I've added a DirectSetMXCSR function to allow setting the MXCSR on platforms 
where Delphi doesnt' support it, a value of $1900 should allow divisions by 
zero to be raised.

Original comment by zar...@gmail.com on 22 Apr 2013 at 1:08