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

Merged
merged 1 commit into from Jan 13, 2013

Conversation

Projects
None yet
3 participants
@9rnsr
Member

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

This comment has been minimized.

Show comment
Hide comment
@yebblies

yebblies Jan 13, 2013

Member

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

Member

yebblies commented Jan 13, 2013

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

@9rnsr

This comment has been minimized.

Show comment
Hide comment
@9rnsr

9rnsr Jan 13, 2013

Member

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.

Member

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

fix Issue 9309 - Regression (2.061): -O -release generates wrong code
In current, all nested functions should be weak purity at most.

@9rnsr 9rnsr reopened this Jan 13, 2013

@9rnsr

This comment has been minimized.

Show comment
Hide comment
@9rnsr

9rnsr Jan 13, 2013

Member

Updated.

Member

9rnsr commented Jan 13, 2013

Updated.

WalterBright added a commit that referenced this pull request Jan 13, 2013

Merge pull request #1474 from 9rnsr/fix9309
Issue 9309 - Regression (2.061): -O -release generates wrong code

@WalterBright WalterBright merged commit 7686d93 into dlang:master Jan 13, 2013

1 check passed

default Pass: 10
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment