acassis commented on PR #19224:
URL: https://github.com/apache/nuttx/pull/19224#issuecomment-4879127141

   @speccy88 I think it should be better to submit a fix to berry mainline, the 
issue is the top variable:
   
   ```
   static int m_fromptr(bvm *vm)
   {   
       int top = be_top(vm);
       if (top >= 1) {
           void* v;
           if (be_iscomptr(vm, 1)) {
               v = be_tocomptr(vm, 1);
           } else {
               v = (void*) (intptr_t) be_toint(vm, 1);
           }
           if (v) {
               bgcobject *ptr = (bgcobject*)v;
               if (var_basetype(ptr) >= BE_GCOBJECT) {
                   bvalue *top = be_incrtop(vm);
                   var_setobj(top, ptr->type, ptr);
               } 
   ```
   
   This last top could be renamed to inc_top.
   
   And type variable:
   
   ```
           int type = be_module_attr(vm, module, str_literal(vm, "setmember"), 
vm->top);
           if (basetype(type) == BE_FUNCTION) {
               bvalue *top = vm->top;
               // top[0] already has 'member'
               var_setstr(&top[1], attr);  /* attribute name */
               top[2] = *src;  /* new value */
               vm->top += 3;   /* prevent collection results */
               be_dofunc(vm, top, 2); /* call method 'setmember' */
               vm->top -= 3;
               int type = var_type(vm->top);
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to