Igalia/pflua — pull request #80 by mpeterv (2014-10-30 14:47:54+00:00)
Title: Fix range inference for binops

1. When inferencing range for a division, rhs range is adjusted to not have 0 as a limit, but the adjusted limits are then never used.
2. When inferencing range for a division, after adjustments, rhs range is split into negative and positive semi-ranges, but the positive one always contains at least `1`, which is incorrect when the adjusted range is entirely negative.

3. When inferencing range for a binary operator, `math.min` and `math.max` are used with arguments which may be NaN even when operand ranges are valid. Standard LuaJIT min and max functions return unexpected results in this case, e.g. `math.min(1, 0/0, 2)` is `2`.

This seems to fix #79, result after fix is
```lua
--- Optimized:
{ "if",
{ "!=",
"len",
0 },
{ "true" },
{ "fail" } }
```

which looks correct to me.