Skip to content

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

Open

Description

@amigalemming

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.

Activity

  1. changed the title [-]unsafe use of pointer into LLVM.Core.Util.constVector[/-] [+]unsafe use of pointer in LLVM.Core.Util.constVector[/+] on Mar 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions