Skip to content

Added tests that demonstrate problems in function pointer removal #936

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

Closed

Conversation

thk123
Copy link
Contributor

@thk123 thk123 commented May 17, 2017

Added two test cases that currently don't work correctly when removing function pointers.

Irrelevant loss of const

If a const primitive is assigned to a non-const primitive, this is classified as a loss of const-ness which causes the FP removal to fall back to worst case behaviour. However, this is a copy so irrelevant and should be ignored.

Array of structs with null pointer

We correctly deal with an array containing FPs including a null pointer, but do not deal with it if the pointer is inside a struct. The behaviour should be consistent.

thk123 added 2 commits May 17, 2017 16:54
Though this example program appears to lose const-ness, since it is a
primitive it is a copy so it is irrelevant.
Uninitialized entries in an array are set to zero (i.e. the struct
contains zero and a null pointer). The output should still generate the
possible valid if statements as it does with an array of function
pointers containing null (as demonstrated in
approx-const-fp-array-variable-const-fp-with-null).
@thk123
Copy link
Contributor Author

thk123 commented Jun 13, 2017

Subsumed by #1007 and #1009

@thk123 thk123 closed this Jun 13, 2017
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.

2 participants