diff options
author | Elronnd | 2017-12-28 14:28:22 -0800 |
---|---|---|
committer | Elronnd | 2017-12-28 14:28:22 -0800 |
commit | 9238b91c7bb5d067ce4ac4b619c1c6e80b3f8340 (patch) | |
tree | 6916cdb03c5264fd08a7b81c95a68b64e0462b3a | |
parent | 92a970f29b7fca3339d15efb7ebb5aa230610359 (diff) | |
download | aur-9238b91c7bb5d067ce4ac4b619c1c6e80b3f8340.tar.gz |
Fix segfault with recursive initializers
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 5 | ||||
-rw-r--r-- | init.diff | 20 |
3 files changed, 27 insertions, 2 deletions
@@ -1,6 +1,6 @@ pkgbase = gdc pkgver = 7.2.0 - pkgrel = 2 + pkgrel = 3 url = https://github.com/D-Programming-GDC/GDC arch = i686 arch = x86_64 @@ -12,11 +12,13 @@ pkgbase = gdc source = gdc::git+https://github.com/D-Programming-GDC/GDC.git source = git+https://github.com/D-Programming-GDC/GDMD.git source = paths.diff + source = init.diff sha256sums = 1cf7adf8ff4b5aa49041c8734bbcf1ad18cc4c94d0029aae0f4e48841088479a sha256sums = 6b8b0fd7f81d0a957beb3679c81bbb34ccc7568d5682844d8924424a0dadcb1b sha256sums = SKIP sha256sums = SKIP sha256sums = fefe9298f8d5859758ca63bab084984baa8adbbd85b3b3b8798283731321df7b + sha256sums = 5f9efcd016389c3940afdc5819c218f44557c816a785f99373d796bebb0e7465 pkgname = gdc pkgdesc = Compiler for D programming language which uses gcc backend @@ -8,7 +8,7 @@ pkgname=('gdc' 'libgphobos-devel' 'libgphobos') pkgver=7.2.0 -pkgrel=2 +pkgrel=3 _islver=0.18 arch=('i686' 'x86_64') license=('GPL') @@ -21,6 +21,7 @@ source=( gdc::git+https://github.com/D-Programming-GDC/GDC.git git+https://github.com/D-Programming-GDC/GDMD.git paths.diff + init.diff ) sha256sums=( '1cf7adf8ff4b5aa49041c8734bbcf1ad18cc4c94d0029aae0f4e48841088479a' @@ -28,6 +29,7 @@ sha256sums=( 'SKIP' 'SKIP' 'fefe9298f8d5859758ca63bab084984baa8adbbd85b3b3b8798283731321df7b' + '5f9efcd016389c3940afdc5819c218f44557c816a785f99373d796bebb0e7465' ) _libdir="usr/lib/gcc/$CHOST/$pkgver" @@ -51,6 +53,7 @@ prepare() { cd $srcdir/gdc git checkout gdc-7 git apply $srcdir/paths.diff + git apply $srcdir/init.diff ./setup-gcc.sh ../gcc-$pkgver mkdir $srcdir/gcc-build diff --git a/init.diff b/init.diff new file mode 100644 index 000000000000..90fbbbc5e54b --- /dev/null +++ b/init.diff @@ -0,0 +1,20 @@ +diff --git a/gcc/d/expr.cc b/gcc/d/expr.cc +index 073fe6ff4..1f67936a2 100644 +--- a/gcc/d/expr.cc ++++ b/gcc/d/expr.cc +@@ -1666,11 +1666,13 @@ class ExprVisitor : public Visitor + StructLiteralExp *sle = ((StructLiteralExp *) e->e1)->origin; + gcc_assert (sle != NULL); + +- /* Build the reference symbol. */ ++ /* Build the reference symbol, the decl is built first as the ++ initializer may have recursive references. */ + if (!sle->sym) + { + sle->sym = build_artificial_decl (build_ctype (sle->type), +- build_expr (sle, true), "S"); ++ NULL_TREE, "S"); ++ DECL_INITIAL (sle->sym) = build_expr (sle, true); + d_pushdecl (sle->sym); + rest_of_decl_compilation (sle->sym, 1, 0); + } |