summarylogtreecommitdiffstats
path: root/workaround-mercury-bug567.patch
diff options
context:
space:
mode:
authorAdrian Perez de Castro2023-11-09 12:44:26 +0200
committerAdrian Perez de Castro2023-11-09 12:44:26 +0200
commit13d1bf7a62833acb3db00d7f4fe67f0b20a99159 (patch)
treef2e51875e6d7ef9f3ad23b59767bc8f694ea3bb6 /workaround-mercury-bug567.patch
parentbe014d0abe991a794fac6ca5c0a71d5e3b325111 (diff)
downloadaur-13d1bf7a62833acb3db00d7f4fe67f0b20a99159.tar.gz
Import upstream patch to workaround compiler bug, allow static linking
Diffstat (limited to 'workaround-mercury-bug567.patch')
-rw-r--r--workaround-mercury-bug567.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/workaround-mercury-bug567.patch b/workaround-mercury-bug567.patch
new file mode 100644
index 000000000000..190e6d3e0eb6
--- /dev/null
+++ b/workaround-mercury-bug567.patch
@@ -0,0 +1,44 @@
+From 2ba8e63f0b36433ed618dd17554656b1dab28201 Mon Sep 17 00:00:00 2001
+From: Peter Wang <novalazy@gmail.com>
+Date: Tue, 7 Nov 2023 13:11:32 +1100
+Subject: [PATCH] Work around Mercury bug 567.
+
+---
+ src/compose.m | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/src/compose.m b/src/compose.m
+index c1767ed..03b49fa 100644
+--- a/src/compose.m
++++ b/src/compose.m
+@@ -2607,6 +2607,7 @@
+ ;
+ Prepare = prepare_edit(_)
+ ),
++ workaround_merge_switches(!Acc),
+ (
+ Prepare = prepare_send,
+ cons(header(field_name("Message-ID"),
+@@ -2617,6 +2618,7 @@
+ ; Prepare = prepare_postpone
+ )
+ ),
++ workaround_merge_switches(!Acc),
+ (
+ ( Prepare = prepare_send
+ ; Prepare = prepare_postpone
+@@ -2678,6 +2680,14 @@
+ cons(header(field_name(FieldName), unstructured(Value, Options)), !Acc)
+ ).
+
++ % Work around Mercury bug 567 -- regression due to commit 43dd12bd
++ % "Merge consecutive switches on the same variable."
++ %
++:- pred workaround_merge_switches(list(header)::in, list(header)::out) is det.
++:- pragma no_inline(workaround_merge_switches/2).
++
++workaround_merge_switches(!Acc).
++
+ %-----------------------------------------------------------------------------%
+
+ :- pred maybe_read_signature_file(prog_config::in, maybe(string)::out,