Open tshort opened 4 years ago
This actually terminates for me on 1.5
:
function pow(x, n)
n == one(n) && return x
n <= zero(n) && return zero(x)
return x * pow(x, n - 1)
end
1: (%1 :: const(pow), %2 :: Float64, %3 :: Int64)
%4 = (==)(%3, 1) :: Bool
br 2 unless %4
br 5 (%2)
2:
%5 = (<=)(%3, 0) :: Bool
br 4 unless %5
br 3
3:
br 5 (0.0)
4:
%6 = (-)(%3, 1) :: Int64
%7 = (pow)(%2, %6) :: Float64
%8 = (*)(%2, %7) :: Float64
br 5 (%8)
5: (%9 :: Float64)
return %9
@shashi you didn't fix this, did you?
Ah - this is broken on master. But it's working on the last release. That's a good diff.
No I didn't fix this, but we should.
The following triggers an infinite loop.