Skip to content

Issue 9309 - Regression (2.061): -O -release generates wrong code#1474

Merged
WalterBright merged 1 commit intodlang:masterfrom
9rnsr:fix9309
Jan 13, 2013
Merged

Issue 9309 - Regression (2.061): -O -release generates wrong code#1474
WalterBright merged 1 commit intodlang:masterfrom
9rnsr:fix9309

Conversation

@9rnsr
Copy link
Contributor

@9rnsr 9rnsr commented Jan 13, 2013

http://d.puremagic.com/issues/show_bug.cgi?id=9309

By merging pull #1110, escapeShellArgument!allocator is marked as PUREstrong.
But it is a nested function, and its call may have a side effect through
its hidden context pointer. So glue layer cannot remove its call.

@yebblies
Copy link
Contributor

How can it be strongly pure if it has mutable state accessible through the context pointer?

@9rnsr
Copy link
Contributor Author

9rnsr commented Jan 13, 2013

Ah..., right. The root problem is in FuncDeclaration::isPure, it does not check fd->isNested().
In current, all nested functions should be weak purity at most.

@9rnsr 9rnsr closed this Jan 13, 2013
In current, all nested functions should be weak purity at most.
@9rnsr 9rnsr reopened this Jan 13, 2013
@9rnsr
Copy link
Contributor Author

9rnsr commented Jan 13, 2013

Updated.

WalterBright added a commit that referenced this pull request Jan 13, 2013
Issue 9309 - Regression (2.061): -O -release generates wrong code
@WalterBright WalterBright merged commit 7686d93 into dlang:master Jan 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants