-
-
Notifications
You must be signed in to change notification settings - Fork 609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix Issue 5212 - no escape analysis for typesafe variadic function ar… #7976
Conversation
|
Thanks for your pull request, @WalterBright! Bugzilla references
|
7e5563d to
379633b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation is fine, though not sure on your comment style and positioning.
| fparam.storageClass |= STC.variadic; | ||
| /* Don't need to set STC.scope_ because this will only | ||
| * be evaluated at compile time | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't comments come before code in a block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the other change, the setting of STC.scope_ came after.
| @@ -604,7 +604,7 @@ private bool functionParameters(Loc loc, Scope* sc, TypeFunction tf, Type tthis, | |||
| nargs++; | |||
| } | |||
|
|
|||
| if (tf.varargs == 2 && i + 1 == nparams) | |||
| if (tf.varargs == 2 && i + 1 == nparams) // https://dlang.org/spec/function.html#variadic | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the link should be put on the line before this condition. Perhaps with a slight introduction also, eg: Handle variadic arguments as per spec <link>.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spec link implies just that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment still - to me at least - looks to be in an awkward place. But well, eye of the beholder and all.
src/dmd/semantic3.d
Outdated
| /* Since it'll be pointing into the stack for the array | ||
| * contents, it needs to be `scope` | ||
| */ | ||
| stc |= STC.scope_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiline indent should probably be given braces.
…guments
The fix is implicitly adding the
scopeannotation.