mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Fix divide by a floating point zero
The code was failing when dividing by 0.0.
This commit is contained in:
parent
4eacb2f234
commit
5d976900d1
@ -962,7 +962,7 @@ class ArithmeticOpAnalyzer
|
||||
} elseif ($operation instanceof PhpParser\Node\Expr\BinaryOp\ShiftRight) {
|
||||
$result = $operand1 >> $operand2;
|
||||
} elseif ($operation instanceof PhpParser\Node\Expr\BinaryOp\Div) {
|
||||
if ($operand2 === 0) {
|
||||
if ($operand2 === 0 || $operand2 === 0.0) {
|
||||
return Type::getNever();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user