eric-haibin-lin opened a new pull request #7783: check num_provided_arg_types 
and nullptr in simple_bind api
URL: https://github.com/apache/incubator-mxnet/pull/7783
 
 
   In the SimpleBind CAPI, it only checks if `provided_arg_stypes == nullptr ` 
to know whether any stype is passed in. In Perl, however, the default value for 
the pointer is not nullptr but some garbage value. See the code generated for 
Perl, where arg19 and arg20 are the default value for the pointers: 
   ```
   XS(_wrap_ExecutorSimpleBind) {
     {
       SymbolHandle arg1 = (SymbolHandle) 0 ;
       ... 
       mx_uint arg18 ;
       char **arg19 = (char **) 0 ;
       int *arg20 = (int *) 0 ;
       mx_uint arg21 ;
       char **arg22 = (char **) 0 ;
       int *arg23 = (int *) 0 ;
       ... 
       mx_uint temp118 ;
       char *temp218 ;
       int temp318 ;
       unsigned int val21 ;
       int ecode21 = 0 ;
       int temp123 ;
       char *temp223 ;
       ... 
   
       {
         arg19 = &temp218;  // <--------- not nullptr
         arg20 = &temp318;  // <--------- not nullptr 
         arg18 = 0;
         *arg19 = NULL;
         *arg20 = 0;
         .... 
   ```
   
   
   @cjolivier01  #7577 failed Perl test because of this. I didn't check if 
there are more cases like this where CAPI assumes the default value of a 
pointer to be nullptr. @sergeykolychev 
   
   @reminisce @piiswrong @bhavinthaker 
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to