about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/hhvm/flexible-array-members-gcc6.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/hhvm/flexible-array-members-gcc6.patch')
-rw-r--r--nixpkgs/pkgs/development/compilers/hhvm/flexible-array-members-gcc6.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/compilers/hhvm/flexible-array-members-gcc6.patch b/nixpkgs/pkgs/development/compilers/hhvm/flexible-array-members-gcc6.patch
new file mode 100644
index 000000000000..61b6e5e8d8c3
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/hhvm/flexible-array-members-gcc6.patch
@@ -0,0 +1,20 @@
+diff --git a/third-party/re2/src/re2/dfa.cc b/third-party/re2/src/re2/dfa.cc
+index 483f678..3aa3610 100644
+--- a/third-party/re2/src/re2/dfa.cc
++++ b/third-party/re2/src/re2/dfa.cc
+@@ -101,8 +101,13 @@ class DFA {
+     uint flag_;         // Empty string bitfield flags in effect on the way
+                         // into this state, along with kFlagMatch if this
+                         // is a matching state.
+-    std::atomic<State*> next_[];    // Outgoing arrows from State,
+-                        // one per input byte class
++// Work around the bug affecting flexible array members in GCC 6.1 and 6.2.
++// (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70932)
++#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ == 6 && __GNUC_MINOR__ >= 1
++    std::atomic<State*> next_[0];   // Outgoing arrows from State, one per input byte class
++#else
++    std::atomic<State*> next_[];    // Outgoing arrows from State, one per input byte class
++#endif
+   };
+
+   enum {