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

unsafe use of pointer in LLVM.Core.Util.constVector #74

Open
amigalemming opened this issue Mar 23, 2014 · 0 comments
Open

unsafe use of pointer in LLVM.Core.Util.constVector #74

amigalemming opened this issue Mar 23, 2014 · 0 comments

Comments

@amigalemming
Copy link

I found the following code in LLVM.Core.Util.constVector:

withArrayLen xs $ \ len ptr ->
    return $ FFI.constVector ptr (fromIntegral len)

I think this won't work reliably, since "ptr" is only valid within withArrayLen and FFI.constVector might be run at any time after withArrayLen finished. I think it is wrong to define FFI.constVector without IO, since this suggests that you can run it somewhen in the future.
This problem might be the cause for some crashes and it occurs at other places as well.

@amigalemming amigalemming changed the title unsafe use of pointer into LLVM.Core.Util.constVector unsafe use of pointer in LLVM.Core.Util.constVector Mar 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant