summaryrefslogtreecommitdiff
path: root/dev-lang/julia/files/julia-1.6.5-lazy_artifacts_fix.patch
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lang/julia/files/julia-1.6.5-lazy_artifacts_fix.patch')
-rw-r--r--dev-lang/julia/files/julia-1.6.5-lazy_artifacts_fix.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/dev-lang/julia/files/julia-1.6.5-lazy_artifacts_fix.patch b/dev-lang/julia/files/julia-1.6.5-lazy_artifacts_fix.patch
new file mode 100644
index 000000000000..9e0d5ecf1a32
--- /dev/null
+++ b/dev-lang/julia/files/julia-1.6.5-lazy_artifacts_fix.patch
@@ -0,0 +1,30 @@
+Patch from
+https://github.com/JuliaLang/julia/commit/d6a655bc.patch
+ Fix LazyArtifacts tests
+
+From d6a655bcfb610130626470e1aa5e2fc28a014b4a Mon Sep 17 00:00:00 2001
+From: Jameson Nash <vtjnash@gmail.com>
+Date: Thu, 24 Dec 2020 00:29:37 -0500
+Subject: [PATCH] codegen: use new freeze intrinsics to avoid poison UB
+ (#38977)
+
+LLVM would likely be required to insert this anyways to make hoisting
+legal (converting branches to and/or), so might as well add it
+ourselves, so that users can legally write that code directly.
+---
+ src/intrinsics.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/intrinsics.cpp b/src/intrinsics.cpp
+index ada6166c1ceb..b5160bbc39c0 100644
+--- a/src/intrinsics.cpp
++++ b/src/intrinsics.cpp
+@@ -542,6 +542,8 @@ static jl_cgval_t generic_cast(
+ #endif
+ }
+ Value *ans = ctx.builder.CreateCast(Op, from, to);
++ if (f == fptosi || f == fptoui)
++ ans = ctx.builder.CreateFreeze(ans);
+ return mark_julia_type(ctx, ans, false, jlto);
+ }
+