From 9b637fc660c5f2e6610d0f967334f046eb4bdad7 Mon Sep 17 00:00:00 2001 From: JinShil Date: Fri, 10 Aug 2018 09:52:36 +0900 Subject: [PATCH 1/2] Fix Issue 19152 - 2.081.1 Regression - Seg fault in traits.d --- src/dmd/traits.d | 2 +- test/compilable/traits.d | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 test/compilable/traits.d diff --git a/src/dmd/traits.d b/src/dmd/traits.d index 1b5c51fb2a1d..03219ea360e2 100644 --- a/src/dmd/traits.d +++ b/src/dmd/traits.d @@ -997,7 +997,7 @@ extern (C++) Expression semanticTraits(TraitsExp e, Scope* sc) // if the parent is an interface declaration // we must check for functions with the same signature // in different inherited interfaces - if (sym.isInterfaceDeclaration()) + if (sym && sym.isInterfaceDeclaration()) insertInterfaceInheritedFunction(fd, e); else exps.push(e); diff --git a/test/compilable/traits.d b/test/compilable/traits.d new file mode 100644 index 000000000000..5dc90fb716fc --- /dev/null +++ b/test/compilable/traits.d @@ -0,0 +1,13 @@ +// This file is intended to contain all compilable traits-related tests in an +// effort to keep the number of files in the `compilable` folder to a minimum. + +// https://issues.dlang.org/show_bug.cgi?id=19152 + +class C19152 +{ + int OnExecute() + { + auto name = __traits(getOverloads, this, "OnExecute").stringof; + return 0; + } +} From c678b73675e1d2bf3be6042bed920e27d3d62490 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Mon, 13 Aug 2018 18:03:14 +0200 Subject: [PATCH 2/2] Fix Semaphore stable branch detection --- semaphoreci.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/semaphoreci.sh b/semaphoreci.sh index 50c94948148d..a209005f86eb 100755 --- a/semaphoreci.sh +++ b/semaphoreci.sh @@ -19,8 +19,7 @@ export OS_NAME=linux export FULL_BUILD="${PULL_REQUEST_NUMBER+false}" # SemaphoreCI doesn't provide a convenient way to the base branch (e.g. master or stable) if [ -n "${PULL_REQUEST_NUMBER:-}" ]; then - # detect master/stable without querying the rate-limited API - BRANCH="$(git describe --all | sed -E "s/.*\/([^-/]*)-.*/\1/")" + BRANCH=$((curl -fsSL https://api.github.com/repos/dlang/dmd/pulls/$PULL_REQUEST_NUMBER || echo) | jq -r '.base.ref') # check if the detected branch actually exists and fallback to master if ! git ls-remote --exit-code --heads https://github.com/dlang/dmd.git "$BRANCH" > /dev/null ; then echo "Invalid branch detected: ${BRANCH} - falling back to master"