-
Notifications
You must be signed in to change notification settings - Fork 79
Checked-c-convert: return type changed to _ptr but returned value not bounded #521
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
Comments
In this specific case the checked type of the return value should be _Nt_array_ptr since indexing is done on it at line 143, but I think the overall problem is that the return type shouldn't be changed automatically if the type of the returned value cannot be changed. |
Probably what happens is that I don't constrain at the site of the return, or if I do, I don't constrain it across all definitions and declarations of the function (there are two). I'll check on that. |
It was the second one. I have this fixed in a branch, going to commit the test case and fix a few more small bugs while I'm here. |
I think this is fixed now, here's the behavior I see:
|
The convert tool has been mostly rewritten (see PR #642). Please reopen this issue if it still exists. |
Sometimes the return type of a function is changed to _Ptr from * but the value actually
return
ed is declared inside the function as * and has no bounds.Example: parson.checked.c:145
Original code: parson.c:145
Error Produced: complains about cast on the
return
statement.To use this test case:
make test
to build the original code.make testchecked
to build with the copies produced by checked-c-convert.convert.sh
runs checked-c-convert on the original code and outputs to*checked*
files. If you re-run it, also edit parson.checked.c to use parson.checked.h. convert.sh may need modifications to run in Windows.compilerErrors.txt
(produced on a Ubuntu system, not sure if it will perfectly match in Windows)The text was updated successfully, but these errors were encountered: