diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2025-04-17 08:21:40 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2025-04-17 08:59:36 +0200 |
commit | 0eae20c899e327aec0e48b9ff2d856aba44b2639 (patch) | |
tree | c7fb1df49b405f208ce25d91fc95209de0e3905c /gcc/d | |
parent | a4f81e168e02b0b1f8894070c6552b85672d4ee5 (diff) | |
download | gcc-0eae20c899e327aec0e48b9ff2d856aba44b2639.zip gcc-0eae20c899e327aec0e48b9ff2d856aba44b2639.tar.gz gcc-0eae20c899e327aec0e48b9ff2d856aba44b2639.tar.bz2 |
d: Fix infinite loop regression in CTFE
An infinite loop was introduced by a previous refactoring in the
semantic pass for DeclarationExp nodes. Ensure the loop properly
terminates and add tests cases.
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd 956e73d64e.
gcc/testsuite/ChangeLog:
* gdc.test/fail_compilation/test21247.d: New test.
* gdc.test/fail_compilation/test21247b.d: New test.
Reviewed-on: https://github.com/dlang/dmd/pull/21248
Diffstat (limited to 'gcc/d')
-rw-r--r-- | gcc/d/dmd/MERGE | 2 | ||||
-rw-r--r-- | gcc/d/dmd/expressionsem.d | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/gcc/d/dmd/MERGE b/gcc/d/dmd/MERGE index ee5eb85..58d19b4 100644 --- a/gcc/d/dmd/MERGE +++ b/gcc/d/dmd/MERGE @@ -1,4 +1,4 @@ -1b34fea4788136b54ec77c6ed9678754d109fc79 +956e73d64e532a68213970316c2590c572ec03f3 The first line of this file holds the git revision number of the last merge done from the dlang/dmd repository. diff --git a/gcc/d/dmd/expressionsem.d b/gcc/d/dmd/expressionsem.d index 19111e3..b02f6ea 100644 --- a/gcc/d/dmd/expressionsem.d +++ b/gcc/d/dmd/expressionsem.d @@ -6978,10 +6978,10 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor while (1) { AttribDeclaration ad = s.isAttribDeclaration(); - if (!ad) - break; - if (ad.decl && ad.decl.length == 1) + if (ad && ad.decl && ad.decl.length == 1) s = (*ad.decl)[0]; + else + break; } //printf("inserting '%s' %p into sc = %p\n", s.toChars(), s, sc); |