Skip to content

Commit 1998364

Browse files
nsajkoKristofferC
authored andcommitted
fix special function ::Real fallback stack overflow (#57790)
Fixes #57789 (cherry picked from commit 6817691)
1 parent 54e1119 commit 1998364

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/math.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,6 +1463,14 @@ end
14631463
end
14641464
end
14651465

1466+
@testset "special function `::Real` fallback shouldn't recur without bound, issue #57789" begin
1467+
mutable struct Issue57789 <: Real end
1468+
Base.float(::Issue57789) = Issue57789()
1469+
for f (sin, sinpi, log, exp)
1470+
@test_throws MethodError f(Issue57789())
1471+
end
1472+
end
1473+
14661474
# Test that sqrt behaves correctly and doesn't exhibit fp80 double rounding.
14671475
# This happened on old glibc versions.
14681476
# Test case from https://sourceware.org/bugzilla/show_bug.cgi?id=14032.

0 commit comments

Comments
 (0)