Skip to content

Commit 809fe8d

Browse files
committed
fix n%0
1 parent 22f29e5 commit 809fe8d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 3.1.1
44
* `FIX` [#1051](https://github.com/sumneko/lua-language-server/issues/1051)
55
* `FIX` [#1072](https://github.com/sumneko/lua-language-server/issues/1072)
6+
* `FIX` runtime errors
67

78
## 3.1.0
89
`2022-4-17`

script/vm/compiler.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,7 @@ local compilerSwitch = util.switch()
15061506
if source.op.type == '%' then
15071507
local a = vm.getNumber(source[1])
15081508
local b = vm.getNumber(source[2])
1509-
if a and b then
1509+
if a and b and b ~= 0 then
15101510
local result = a % b
15111511
vm.setNode(source, {
15121512
type = math.type(result) == 'integer' and 'integer' or 'number',

0 commit comments

Comments
 (0)