Repository navigation
Fix Issue 19688 - [ICE] Default function argument concatenation crashes DMD - #9377
Merged
Merged
Conversation
|
Thanks for your pull request and interest in making D better, @RazvanN7! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + dmd#9377" |
thewilsonator
approved these changes
Feb 20, 2019
RazvanN7
force-pushed
the
Issue_19688
branch
from
February 20, 2019 13:28
415a988 to
7e8b2fd
Compare
Contributor
ALL BUGFIXES SHOULD TARGET STABLE!!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
__FUNCTION__and__PRETTY_FUNCTION__, unlike the other special attributes (__LINE__,__MODULE__etc.), cannot be resolved at parse time when they are used as default function arguments because they need to be evaluated to the function in where the call takes place. The problem here is that when default arguments are evaluated infunctionParameters[1], resolveLoc is called on a CatExp AST node which does not implement an override for resolveLoc, so it defaults to the one in Expression, which does .... nothing. In order to fix this, I overloaded the function and recursively called resolveLoc on the expressions of the CatExp.[1] https://github.com/dlang/dmd/blob/master/src/dmd/expressionsem.d#L1739