clasp icon indicating copy to clipboard operation
clasp copied to clipboard

Possible CLBIND bug: last argument of exposed function not converted correctly

Open dg1sbg opened this issue 7 years ago • 0 comments

When exposing a function. e.g. DDSDomainParticipantFactory::create_participant(...) - see https://community.rti.com/static/documentation/connext-dds/5.3.0/doc/api/connext_dds/api_cpp/classDDSDomainParticipantFactory.html#af7c7137eccd41ffa9351d577fb088417 for more details - with the following code:

`package( DDSPkg ) [ class_< DDS::Entity >( "Entity", no_default_constructor ),

      class_< DDS::DomainParticipant, DDS::Entity >( "DomainParticipant", no_default_constructor ),

      class_< DDS::DomainParticipantFactory >( "DomainParticipantFactory", no_default_constructor )
      .def( "create_participant", &DDS::DomainParticipantFactory::create_participant /*, policies<>(), "", "", "" */ )
   ];`

then a call in Lisp like

(dds::create-participant dpf 42 nil nil dds:*dds-status-mask-none*)))) ;; dds:*dds-status-mask-none* has value 0, dpf is a valid object pointer.

is seen in clbind with args being:

*** -> CLBIND: Function entry_point in line 301: at OBJPTR *** -> CLBIND: objptr = #< DOMAIN-PARTICIPANT-FACTORY > *** -> CLBIND: Function entry_point in line 305: at ARG 1 *** -> CLBIND: arg = 42 *** -> CLBIND: Function entry_point in line 309: at ARG 2 *** -> CLBIND: arg = NIL *** -> CLBIND: Function entry_point in line 314: at ARG 3 *** -> CLBIND: arg = NIL *** -> CLBIND: Function entry_point in line 318: at ARG 4 *** -> CLBIND: arg = (#< DOMAIN-PARTICIPANT-FACTORY > 42 NIL NIL 0)

(This is output from instrumented code at: [https://github.com/dg1sbg/clasp/blob/dev/include/clasp/clbind/generated/clbind_methoids.h#L270])

As the last line clearly shows, this is a Vaslist and not the remaining 4th arg intended to be fixnum 0.

dg1sbg avatar Feb 23 '18 21:02 dg1sbg