-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Open
Labels
compiler:llvmFor issues that relate to LLVMFor issues that relate to LLVMcorrectness bug ⚠Bugs that are likely to lead to incorrect results in user code without throwingBugs that are likely to lead to incorrect results in user code without throwingerror handlingHandling of exceptions by Julia or the userHandling of exceptions by Julia or the user
Description
The LLVM optimizer can be tricked into not observing memory effects on will-throw branches, since it does not know they will resume at the catch branch. We can turn that into a miscompile using SSAValue (as otherwise slot2ssa would normally put a phic node here on any attempted direct use of x
which would inhibit llvm from doing any analysis of it)
julia> function foo()
x = Ref(0)
for i in ((0,x), (1,x))
i[1] == 1 && return i[2][]
try; i[2][] = 1; throw("intentional"); catch; end
end
throw("unreachable")
end
foo (generic function with 1 methods)
julia> foo() # this should return 1
0
Metadata
Metadata
Assignees
Labels
compiler:llvmFor issues that relate to LLVMFor issues that relate to LLVMcorrectness bug ⚠Bugs that are likely to lead to incorrect results in user code without throwingBugs that are likely to lead to incorrect results in user code without throwingerror handlingHandling of exceptions by Julia or the userHandling of exceptions by Julia or the user