Igalia/pflua — pull request #71 by mpeterv (2014-10-21 07:36:11+00:00)
Title: Fix division expansion

When expanding division operator, an assertion about divisor being non-zero is added to other assertions using `utils.concat`. It is not wrapped in an array currently, resulting in crashes when compiling expressions containing division.

Testcase:

```bash
$ cd src
$ ../deps/luajit/usr/local/bin/luajit ../tools/pflang-compile '1/1 > 0'
```

Result before fix:

```
../deps/luajit/usr/local/bin/luajit: ./pf/optimize.lua:183: attempt to index local 'test' (a number value)
stack traceback:
./pf/optimize.lua:183: in function 'simplify'
./pf/optimize.lua:173: in function 'simplify'
./pf/optimize.lua:173: in function 'simplify'
./pf/optimize.lua:687: in function 'f'
./pf/optimize.lua:682: in function 'fixpoint'
./pf/optimize.lua:696: in function 'optimize'
./pf.lua:32: in function 'compile_filter'
../tools/pflang-compile:50: in main chunk
[C]: at 0x0804c020
```

Result after fix:

```
return function(P,length)
do return true end
end
```

Also added two small tests for expanding and optimizing division.