Commit 05fd573
committed
Fix unsigned int to floating point number conversion
Simplest repro:
Convert(Constant(uint.MaxValue), typeof(double))
Previously it would return -1, since the conv.r.un instruction wasn't
used. It was only applied to uint->float, but not for double or any
other integer type. Only uint/ulong was problematic, but the test covers
all integer types.
(nuint/nint are not supported by Linq.Expression conversions)1 parent 7404512 commit 05fd573
File tree
2 files changed
+32
-2
lines changed- src/FastExpressionCompiler
- test/FastExpressionCompiler.UnitTests
2 files changed
+32
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3508 | 3508 | | |
3509 | 3509 | | |
3510 | 3510 | | |
| 3511 | + | |
| 3512 | + | |
3511 | 3513 | | |
3512 | 3514 | | |
3513 | 3515 | | |
3514 | | - | |
| 3516 | + | |
3515 | 3517 | | |
3516 | 3518 | | |
3517 | 3519 | | |
| |||
Lines changed: 29 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | | - | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
98 | 126 | | |
99 | 127 | | |
100 | 128 | | |
| |||
0 commit comments