Browse Source

FFI: Don't propagate qualifiers into subtypes of complex.

Mike Pall 10 years ago
parent
commit
a5b1c4d98e
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/lj_cparse.c

+ 4 - 0
src/lj_cparse.c

@@ -798,6 +798,10 @@ static void cp_push_type(CPDecl *decl, CTypeID id)
     cp_push(decl, info & ~CTMASK_CID, size);  /* Copy type. */
     cp_push(decl, info & ~CTMASK_CID, size);  /* Copy type. */
     break;
     break;
   case CT_ARRAY:
   case CT_ARRAY:
+    if ((ct->info & (CTF_VECTOR|CTF_COMPLEX))) {
+      info |= (decl->attr & CTF_QUAL);
+      decl->attr &= ~CTF_QUAL;
+    }
     cp_push_type(decl, ctype_cid(info));  /* Unroll. */
     cp_push_type(decl, ctype_cid(info));  /* Unroll. */
     cp_push(decl, info & ~CTMASK_CID, size);  /* Copy type. */
     cp_push(decl, info & ~CTMASK_CID, size);  /* Copy type. */
     decl->stack[decl->pos].sib = 1;  /* Mark as already checked and sized. */
     decl->stack[decl->pos].sib = 1;  /* Mark as already checked and sized. */