Skip to content
This repository has been archived by the owner on Jun 20, 2019. It is now read-only.

Fix ice-invalid when initializing struct with an array #145

Merged
merged 1 commit into from
Oct 11, 2015
Merged

Fix ice-invalid when initializing struct with an array #145

merged 1 commit into from
Oct 11, 2015

Conversation

Ace17
Copy link

@Ace17 Ace17 commented Oct 11, 2015

The following patch fixes a crash on the following invalid code:

struct S
{
}

S g =
[
{ 1[] }
];

@yebblies
Copy link

Upstream PR: dlang/dmd#4310


* init.c(ArrayInitializer::semantic): Fail when toExpression returns a
null pointer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upstream have their own changelog, you don't need this here. :-)

@ibuclaw
Copy link
Member

ibuclaw commented Oct 11, 2015

Which version of dmd did this fix make it into? Since I only take care to not make changes to code that is wrapped around #ifdef IN_GCC, the next merge may regress this change.

@Ace17
Copy link
Author

Ace17 commented Oct 11, 2015

I'm having a hard time understanding your comment :-)
Do you mean we should not change code wrapped around IN_GCC? Or the contrary?
Do you plan to still merge from the upstream dmd frontend, although it's been ported to D?

@ibuclaw
Copy link
Member

ibuclaw commented Oct 11, 2015

Do you mean we should not change code wrapped around IN_GCC? Or the contrary?

Since there are thousands of lines of changes between any given upstream release, I can't be expected to remember where every local change is. So the only marker I can rely upon is that code is wrapped around #ifdef IN_GCC.

How that relates to this PR?

  • If this is a backport from 2.067, then this should be OK.
  • If this is from 2.068, then this PR will be reverted when merging 2.067 (because I won't know otherwise).

@ibuclaw
Copy link
Member

ibuclaw commented Oct 11, 2015

Do you plan to still merge from the upstream dmd frontend, although it's been ported to D?

More likely, there will be two trees, one with 2.068, and another with 2.069+. The former will need to be able to bootstrap the latter until we have enough coverage with ports to make the switch over proper.

Ideally, this means that there will be binaries for all primary GCC platforms. (https://gcc.gnu.org/gcc-5/criteria.html)
Failing doing that ourselves, rely on a package distributor with wide support, such as Debian.

As a compromise situation, we could always add logic to the build scripts so that if no D compiler exists, bootstrap 2.068 first. I think LDC are going to be doing this too when the time comes for them.

@Ace17
Copy link
Author

Ace17 commented Oct 11, 2015

OK, I get it ; thanks for explaining.
I confirm this fix is already present in 2.067 ( https://github.com/D-Programming-Language/dmd/blob/2.067/src/init.c#L437 ).

ibuclaw added a commit that referenced this pull request Oct 11, 2015
Fix ice-invalid when initializing struct with an array
@ibuclaw ibuclaw merged commit fb5a52d into D-Programming-GDC:master Oct 11, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants