The fix works, but:

1) It adds a continuation barrier where there was none before.  I think
this makes sens.

2) What do you suggest to do for the value of `ret' when an exception is
raised?  It seems that by default, libffi will initialize it to 0, but
this is not documented.  I guess that what we want is for the returned
value of `scm_with_guile' to be used instead.  However, when an
exception is raised, the continuation barrier will return NULL.  We
could pass a success flag to `do_invoke_closure'.  If the flag is not
set after returning from `scm_with_guile`, we know that something bad
happened.  Now the question is what should we do?  Perhaps,
`procedure->pointer' could accept a new argument `#:error-value', which
would be unset by default.  If unset, the returned value is unpacked
with some pre-define values:

  - floats: 0.0
  - integers: 0
  - pointer: NULL
  - struct: null bytevector ?
  
Thanks,
Olivier
-- 
Olivier Dion




Reply via email to