Print this page
12259 CTF shouldn't assume enum size

@@ -23,11 +23,11 @@
 /*
  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 /*
- * Copyright 2018 Joyent, Inc.
+ * Copyright 2020 Joyent, Inc.
  */
 
 #include <ctf_impl.h>
 #include <sys/debug.h>
 

@@ -479,11 +479,11 @@
 
         case CTF_K_FORWARD:
                 return (0);
 
         case CTF_K_ENUM:
-                return (fp->ctf_dmodel->ctd_int);
+                return (ctf_get_ctt_size(fp, tp, NULL, NULL));
 
         case CTF_K_ARRAY:
                 /*
                  * Array size is not directly returned by stabs data.  Instead,
                  * it defines the element type and requires the user to perform

@@ -576,12 +576,10 @@
 
                 return (align);
         }
 
         case CTF_K_ENUM:
-                return (fp->ctf_dmodel->ctd_int);
-
         default:
                 return (ctf_get_ctt_size(fp, tp, NULL, NULL));
         }
 }