-
Notifications
You must be signed in to change notification settings - Fork 25
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
CertiCoq FFI
produces bad C code
#56
Comments
Hm also it seems that the generated code lacks any checks before doing allocations, possibly leading to Also given the fact that the If anyone from the maintainers is reading this, what's the intended status of this feature? Is it still work in progress, or is it some legacy that's no longer maintained? |
Thank you for reaching out @kuruczgy! You happened to catch us while most folks are either on vacation or preparing for the next term at university. We are tracking and will update this thread |
Thank you for your response :) Of course, I don't have any expectations on when this will get looked at, given that this is an open source project. Just wanted to leave it here for future reference, in case it's useful to someone. |
Hi, I added the |
I see, thanks. I guess my main question has been answered then. I am not sure what your policy is with the GitHub issues, do as you wish with this one. You can either close it now since the main question has been answered, or keep it around until |
Environment
certicoq commit a426ffe
Alpine linux 3.16.2
Steps to reproduce
(This actual test input is not relevant,
CertiCoq FFI
generates incorrect output on any type class I tried.)coqc Test.v
gcc -w -c ffi.Test.Test.c
Expected behavior
The generated C file compiles without errors.
Actual behavior
Some variable definitions are wrong. An excerpt from
ffi.Test.Test.c
:The variable should be declared as
$result
instead ofresult
.tinfo
is also wrong, but the other way around.Workaround
This is what I came up with for now, seems to be working so far:
sed -i 's/\$\(result\|arg[0-9]\?\|pair\|new_env\|new_clo\|tinfo\|env\)/\1/g' ffi.*.c
The text was updated successfully, but these errors were encountered: