Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/prometheus/ast.lua
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ function Ast.MulExpression(lhs, rhs, simplify)
end

function Ast.DivExpression(lhs, rhs, simplify)
if(simplify and rhs.isConstant and lhs.isConstant) then
if(simplify and rhs.isConstant and lhs.isConstant and rhs.value ~= 0) then
local success, val = pcall(function() return lhs.value / rhs.value end);
if success then
return Ast.ConstantNode(val);
Expand Down