Skip to content
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

3C test failures when checking return bounds #1147

Closed
kkjeer opened this issue Aug 7, 2021 · 4 comments
Closed

3C test failures when checking return bounds #1147

kkjeer opened this issue Aug 7, 2021 · 4 comments
Labels
work item This labels issues that are not exactly bugs but are about improvements.

Comments

@kkjeer
Copy link
Contributor

kkjeer commented Aug 7, 2021

The test files 3C/functionDeclEnd.c and 3C/itype_nt_arr_cast.c contain functions that have declared bounds via a bounds-safe interface, and return expressions with unknown bounds. With the work to check that return value bounds imply the enclosing function's declared bounds (on the branch check-return-bounds, PR pending), these functions result in compile-time errors, causing these two tests to fail.

The tests have been marked as XFAIL for now on the check-return-bounds branch. However, these tests should be updated so that they do not result in compile-time errors.

@kkjeer kkjeer added the work item This labels issues that are not exactly bugs but are about improvements. label Aug 7, 2021
@kkjeer
Copy link
Contributor Author

kkjeer commented Aug 17, 2021

After updating #1150 to account for the behavior specified in #1157, there are no longer bounds errors emitted when checking return bounds for an unchecked return value in an unchecked scope for a function with a bounds-safe interface. After this change, itype_nt_arr_cast.c passes. The only function in functionDeclEnd.c that results in an error is test7 (in a checked scope).

@mattmccutchen-cci
Copy link
Member

Thanks. I filed correctcomputation#682 for us to decide what to do about functionDeclEnd.c, so I think you can close this issue in favor of ours if you like.

@mattmccutchen-cci
Copy link
Member

We now have a fix that you can go ahead and incorporate into #1150 if you like. (Or we could submit the test fix first as a separate PR to your repository, but that would probably end up being more work for everyone.) Further information is in correctcomputation#684 if you're interested.

@kkjeer
Copy link
Contributor Author

kkjeer commented Aug 18, 2021

Thanks for the fix! I've cherry-picked it into #1150. I can close this issue once the automated tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
work item This labels issues that are not exactly bugs but are about improvements.
Projects
None yet
Development

No branches or pull requests

2 participants