This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug objc/24868] New: objc-act.c builds non-type-safe structure


The init_objc_symtab builds a structure with two short data members, but passes
NULL_TREE into build_int_cst.  These:

---
  /* cls_def_cnt = { ..., 5, ... } */
  initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, imp_count),
initlist);
  /* cat_def_cnt = { ..., 5, ... } */
  initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, cat_count),
initlist);
---

Should be changed to pass short_integer_type_node to build_int_cst instead of
NULL_TREE.  Passing NULL_TREE results in a 32-bit int.  This appears to not
cause a problem with the current code generator, but seems like a nasty latent
bug.

-Chris


-- 
           Summary: objc-act.c builds non-type-safe structure
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: objc
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sabre at nondot dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24868


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]