-
Notifications
You must be signed in to change notification settings - Fork 1.5k
do not set values if there is no expression #7295
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
Conversation
All tests still pass with the early returns added. Example output:
Looks like this is related to unnamed parameters. @pfultz2 please have a look. |
Happens with unnamed parameters when a function body exists: void cb(int) {}
void func()
{
cb(0);
}
Naming the parameter fixes it:
|
7920895
to
e22ec20
Compare
The |
64bdf89
to
6cd4d80
Compare
if (declId == 0) | ||
continue; // TODO: should never happen? |
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.
This occurs in e.g. TestAutoVariables::testinvaliddealloc
.
The Variable
has no mNameToken
and points to void*
which appears to be the injected parameter for free()
. The errorPath
in the values seems to support this:
Address of variable taken here.
Calling function 'free', 1st argument '&c2' value is lifetime=c2
Not sure if something with the injecting is lacking data. But I do not think this needs to be solved in the scope of this PR.
@pfultz2 Any thoughts?
5bd5804
to
1569700
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.
spontanously this sounds good to me.
what is the motivation?
is there speedup or change of results or simpler code?
I cannot remember how I came across this but I assume it was in the context of some of the other drafts PRs where I try to get rid of unnecessary calls. Depending on the code this might have performance implications as less values are being generated. |
828da56
to
cfb9e74
Compare
|
I tested it with #7800 and there were no differences in the output. |
No description provided.