]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
compiler: don't set ptrmask bit for pointer to notinheap type
authorIan Lance Taylor <iant@golang.org>
Sat, 12 Feb 2022 22:54:21 +0000 (14:54 -0800)
committerIan Lance Taylor <iant@golang.org>
Sun, 13 Feb 2022 18:54:26 +0000 (10:54 -0800)
Test case is https://go.dev/cl/385454.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/385474

gcc/go/gofrontend/MERGE
gcc/go/gofrontend/types.cc

index 4e6bac7b7d50838c2993a115fff0aacd28d22bda..02a6e1d661dc27a64e2d4d898dd1f96726453901 100644 (file)
@@ -1,4 +1,4 @@
-47380f733ca932384e59492d2f04374edd8ec95e
+7f8fee099d6de4a5a857765e0ddfae356ead554c
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index ee3467666d87caac60cb29fb35f28e07cae5fa05..8267f1565ce6c37a71df94693f8b4ae12516b167 100644 (file)
@@ -2816,6 +2816,9 @@ class Ptrmask
 void
 Ptrmask::set_from(Gogo* gogo, Type* type, int64_t ptrsize, int64_t offset)
 {
+  if (!type->has_pointer())
+    return;
+
   switch (type->base()->classification())
     {
     default:
@@ -2858,9 +2861,6 @@ Ptrmask::set_from(Gogo* gogo, Type* type, int64_t ptrsize, int64_t offset)
 
     case Type::TYPE_STRUCT:
       {
-       if (!type->has_pointer())
-         return;
-
        const Struct_field_list* fields = type->struct_type()->fields();
        int64_t soffset = 0;
        for (Struct_field_list::const_iterator pf = fields->begin();
@@ -2898,9 +2898,6 @@ Ptrmask::set_from(Gogo* gogo, Type* type, int64_t ptrsize, int64_t offset)
        }
       else
        {
-         if (!type->has_pointer())
-           return;
-
          int64_t len;
          if (!type->array_type()->int_length(&len))
            {