Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive

Comments

Workaround 11461: avoid strong purity inference by passing null pointer to onOutOfMemoryError#753

Merged
MartinNowak merged 1 commit intodlang:masterfrom
rainers:workaround_bug11461
Mar 24, 2014
Merged

Workaround 11461: avoid strong purity inference by passing null pointer to onOutOfMemoryError#753
MartinNowak merged 1 commit intodlang:masterfrom
rainers:workaround_bug11461

Conversation

@rainers
Copy link
Member

@rainers rainers commented Mar 23, 2014

As discussed in https://d.puremagic.com/issues/show_bug.cgi?id=11461, this seems the better workaround as it allows keeping the pure attribute.
I added the same to onInvalidMemorypertionError, it suffered from the same issue.

@denis-sh
Copy link
Contributor

Same mistake as in dlang/dmd#3342 : the (unofficial) term is "strong", not "strict".

@rainers rainers changed the title Workaround 11461: avoid strict purity inference by passing null pointer to onOutOfMemoryError Workaround 11461: avoid strong purity inference by passing null pointer to onOutOfMemoryError Mar 23, 2014
@rainers
Copy link
Member Author

rainers commented Mar 23, 2014

Same mistake as in dlang/dmd#3342 : the (unofficial) term is "strong", not "strict".

Hmmm, I must have picked up that term from the other PR. I changed the title.

@monarchdodra
Copy link
Contributor

As mentioned though, the compiler could statically catch that the passed parameter is null, and decide to apply strong purity to the weakly pure function?

@MartinNowak
Copy link
Member

As mentioned though, the compiler could statically catch that the passed parameter is null, and decide to apply strong purity to the weakly pure function?

It's a workaround not a solution so it must not be perfect.

@MartinNowak
Copy link
Member

Auto-merge toggled on

MartinNowak added a commit that referenced this pull request Mar 24, 2014
Workaround 11461: avoid strong purity inference by passing null pointer to onOutOfMemoryError
@MartinNowak MartinNowak merged commit 2a50cea into dlang:master Mar 24, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants