Tests for CFFI-FSBV libffi; fix return value translation in ffcall-body-libffi
Tests fsbv.1 and fsbv.2 added that test foreign structure call and return by value. This includes the C file and addition to makefile to generate the appropriate library, libfsbv. So that the tests are properly defined, load cffi-fsbv and then cffi-tests. Both tests should pass. The test returning a structure, fsbv.2, exposed an error in the form generated by ffcall-body-libffi; because it always generated a mem-aref on the return value, the subsequent translate-from-foreign was effectively making a double translation. Thus, this form generation has been conditionalized so that if translate-from-foreign will not be applied (e.g., built-in-type) to call mem-aref, otherwise just return the pointer.
parent
4064d278
Please register or sign in to comment