[Bug objc/101666] Objective-C frontend crashes with `-fobjc-nilcheck`

mhjacobson at me dot com gcc-bugzilla@gcc.gnu.org
Wed Jul 28 23:33:51 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101666

--- Comment #1 from Matt Jacobson <mhjacobson at me dot com> ---
I'm not an expert on GCC ASTs, but would this change be correct here?  I'm
trying to simulate something like `struct whatever ftree[8 * 3] = {0};`.

diff --git a/gcc/objc/objc-next-runtime-abi-02.c
b/gcc/objc/objc-next-runtime-abi-02.c
index e401906ed..0cc19a079 100644
--- a/gcc/objc/objc-next-runtime-abi-02.c
+++ b/gcc/objc/objc-next-runtime-abi-02.c
@@ -1631,9 +1631,8 @@ build_v2_build_objc_method_call (int super_flag, tree
method_prototype,
          || TREE_CODE (ret_type) == UNION_TYPE)
        {
          vec<constructor_elt, va_gc> *rtt = NULL;
-         /* ??? CHECKME. hmmm..... think we need something more
-            here.  */
-         CONSTRUCTOR_APPEND_ELT (rtt, NULL_TREE, NULL_TREE);
+         CONSTRUCTOR_APPEND_ELT (rtt, NULL_TREE, build_int_cst
(integer_type_node,
+                                                           0));
          ftree = objc_build_constructor (ret_type, rtt);
        }
       else


More information about the Gcc-bugs mailing list