We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
As a follow-up to the question in #1538, the user reports:
Output parameters seem to have the same issue. For example, if you have this function: foreign myfunc : {n} (fin n) => [n][32] -> [n + 1][32] Cryptol will only take the first n elements of the output from the FFI function.
Output parameters seem to have the same issue. For example, if you have this function:
foreign myfunc : {n} (fin n) => [n][32] -> [n + 1][32]
Cryptol will only take the first n elements of the output from the FFI function.
I am unable to reproduce this. The corresponding C function should have the signature
void myfunc(size_t n, uint32_t * in, uint32_t * out);
as generated by the :generate-foreign-header Cryptol REPL command. With the following C implementation,
:generate-foreign-header
void myfunc(size_t n, uint32_t * in, uint32_t * out) { for (size_t i = 0; i < n; ++i) { out[i] = in[i]; } out[n] = 42; }
it seems to return the correct result:
Cryptol> :l test.cry Loading module Cryptol Loading module Main Loading dynamic library test.so Main> :t myfunc myfunc : {n} (fin n) => [n][32] -> [1 + n][32] Main> myfunc [1, 2, 3, 4, 5] [0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x0000002a]
If there are more details regarding the situation in which this bug happens, that would be appreciated!
cc @eddywestbrook @weaversa
The text was updated successfully, but these errors were encountered:
No branches or pull requests
As a follow-up to the question in #1538, the user reports:
I am unable to reproduce this. The corresponding C function should have the signature
as generated by the
:generate-foreign-header
Cryptol REPL command. With the following C implementation,it seems to return the correct result:
If there are more details regarding the situation in which this bug happens, that would be appreciated!
cc @eddywestbrook @weaversa
The text was updated successfully, but these errors were encountered: