From cd2c60fe2bdf5ea047845f6da426d4b5455ed503 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 11 Nov 2013 12:54:02 -0500 Subject: [PATCH] Add patch backport --- ...ed22d9b5c33f5b33221e906946b11a9bde3b.patch | 40 +++++++++++++++++++ dbus.spec | 4 ++ 2 files changed, 44 insertions(+) create mode 100644 avoid-undefined-7c00ed22d9b5c33f5b33221e906946b11a9bde3b.patch diff --git a/avoid-undefined-7c00ed22d9b5c33f5b33221e906946b11a9bde3b.patch b/avoid-undefined-7c00ed22d9b5c33f5b33221e906946b11a9bde3b.patch new file mode 100644 index 0000000..3f13319 --- /dev/null +++ b/avoid-undefined-7c00ed22d9b5c33f5b33221e906946b11a9bde3b.patch @@ -0,0 +1,40 @@ +From 7c00ed22d9b5c33f5b33221e906946b11a9bde3b Mon Sep 17 00:00:00 2001 +From: DreamNik +Date: Sun, 29 Sep 2013 10:45:58 +0000 +Subject: make_and_run_test_nodes: avoid undefined behaviour + +In code that looks like n[i] = v(&i), where v increments i, C leaves it +undefined whether the old or new value of i is used to locate n[i]. +As it happens, gcc used the pre-increment value of i, but MSVC +used the post-increment value. + +Fix this by inserting a sequence point to disambiguate the intended order. + +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69924 +Reviewed-by: Chengwei Yang +Reviewed-by: Simon McVittie +[wrote commit message, fixed whitespace -smcv] +Signed-off-by: Simon McVittie +--- +diff --git a/dbus/dbus-marshal-recursive-util.c b/dbus/dbus-marshal-recursive-util.c +index 9512414..a2aaaf9 100644 +--- a/dbus/dbus-marshal-recursive-util.c ++++ b/dbus/dbus-marshal-recursive-util.c +@@ -1785,10 +1785,13 @@ make_and_run_test_nodes (void) + start_next_test ("All values in one big toplevel %d iteration\n", 1); + { + TestTypeNode *nodes[N_VALUES]; ++ TestTypeNode *node; + + i = 0; +- while ((nodes[i] = value_generator (&i))) +- ; ++ while ((node = value_generator (&i))) ++ { ++ nodes[i - 1] = node; ++ } + + run_test_nodes (nodes, N_VALUES); + +-- +cgit v0.9.0.2-2-gbebe diff --git a/dbus.spec b/dbus.spec index d5ee64f..6ceb6ee 100644 --- a/dbus.spec +++ b/dbus.spec @@ -51,6 +51,7 @@ BuildRequires: /usr/bin/Xvfb # FIXME this should be upstreamed; need --daemon-bindir=/bin and --bindir=/usr/bin or something? Patch0: bindir.patch Patch1: 0001-name-test-Don-t-run-test-autolaunch-if-we-don-t-have.patch +Patch2: avoid-undefined-7c00ed22d9b5c33f5b33221e906946b11a9bde3b.patch %description D-BUS is a system for sending messages between applications. It is @@ -101,6 +102,7 @@ in this separate package so server systems need not install X. %patch0 -p1 -b .bindir %patch1 -p1 +%patch2 -p1 %build if test -f autogen.sh; then env NOCONFIGURE=1 ./autogen.sh; else autoreconf -v -f -i; fi @@ -246,6 +248,8 @@ fi %changelog * Mon Nov 11 2013 Colin Walters - 1:1.6.18-1 - New upstream version +- Added backported patch which should fix the test suite; thanks to + Yanko Kaneti for the suggestion. * Wed Jul 24 2013 Colin Walters - 1:1.6.12-4 - Add patch to fix test-marshal on s390.