Opened 7 years ago
Closed 7 years ago
#1424 closed defect (fixed)
(const c-string) as result type breaks with NULL
Reported by: | Vasilij Schneidermann | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 4.13.0 |
Component: | compiler | Version: | 4.11.0 |
Keywords: | foreign | Cc: | |
Estimated difficulty: |
Description
I'm writing bindings to a library which uses const
on both string argument and return types. If I declare a foreign function returning NULL
to have (const c-string)
as return type, I get a segmentation violation, c-string
as return type however returns #f
as expected.
Minimal repro:
(import chicken scheme foreign) #> static const char* test() { return NULL; } <# (define test (foreign-lambda c-string "test")) (define test2 (foreign-lambda (const c-string) "test")) (test) ;=> #f (test2) ;=> segfault
Change History (2)
comment:2 Changed 7 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed with a0bb345 and c3393980.
Note: See
TracTickets for help on using
tickets.
FWIW, the C4 patch resolves the issue for me. The C5 one also works as intended, before I got a "cannot compute size of location for foreign type" error.