haskell/c2hs — pull request #112 by KaiHa (2014-09-30 20:31:11+00:00)
Title: segmentation fault when accesing array inside struct

Dear Maintainer,

when I am trying to access an array inside a struct by using {#get#} my program fails with a segmentation fault.

Doing the following change to the produced .hs file gives me the expected behavior:
```diff
- a <- (\ptr -> do {peekByteOff ptr 0 ::IO (Ptr CInt)}) myStruct >>= peekArray 3
+ a <- (\ptr -> do {return (plusPtr ptr 0) ::IO (Ptr CInt)}) myStruct >>= peekArray 3
```
I have attached an test case which can reproduce this issue.

Kind regards,

Kai Harries