Limit FFI calls by default to explicitly supported ones#2428
Merged
celinval merged 9 commits intomodel-checking:mainfrom May 5, 2023
Merged
Limit FFI calls by default to explicitly supported ones#2428celinval merged 9 commits intomodel-checking:mainfrom
celinval merged 9 commits intomodel-checking:mainfrom
Conversation
C-FFI is pretty broken right now. Limit its usage to only support built-in functions that are explicitly included in Kani. User's should still be enable to go back to previous behavior by enabling unstable C-FFI support
8eebbc7 to
7646caa
Compare
zhassan-aws
reviewed
May 5, 2023
Contributor
zhassan-aws
left a comment
There was a problem hiding this comment.
Looks good. Mostly minor comments.
kani-compiler/src/codegen_cprover_gotoc/codegen/foreign_function.rs
Outdated
Show resolved
Hide resolved
kani-compiler/src/codegen_cprover_gotoc/codegen/foreign_function.rs
Outdated
Show resolved
Hide resolved
zhassan-aws
reviewed
May 5, 2023
Co-authored-by: Zyad Hassan <88045115+zhassan-aws@users.noreply.github.com>
feliperodri
reviewed
May 5, 2023
- Add / improve comments - Add expected file - Fix variadic test - improve test
zhassan-aws
approved these changes
May 5, 2023
kani-compiler/src/codegen_cprover_gotoc/codegen/foreign_function.rs
Outdated
Show resolved
Hide resolved
…on.rs Co-authored-by: Zyad Hassan <88045115+zhassan-aws@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes:
C-FFI is fairly unstable right now and the lack of error handling causes a poor experience when things go wrong.
In this PR, we limit its usage to only support CBMC built-in functions that are explicitly included in Kani and alloc functions from
kani_lib.c. User's should still be enable to go back to previous behavior by enabling unstable C-FFI supportResolved issues:
Resolves #1781
Related RFC:
Call-outs:
This PR is currently blocked by #2427. Once that gets merged, the regression should pass.
Testing:
How is this change tested? New tests
Is this a refactor change? Kinda
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.