Print this page
rm code review
12259 CTF shouldn't assume enum size

*** 23,33 **** /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ /* ! * Copyright 2018 Joyent, Inc. */ #include <ctf_impl.h> #include <sys/debug.h> --- 23,33 ---- /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ /* ! * Copyright 2020 Joyent, Inc. */ #include <ctf_impl.h> #include <sys/debug.h>
*** 52,61 **** --- 52,73 ---- *incrementp = increment; return (size); } + void + ctf_set_ctt_size(ctf_type_t *tp, ssize_t size) + { + if (size > CTF_MAX_SIZE) { + tp->ctt_size = CTF_LSIZE_SENT; + tp->ctt_lsizehi = CTF_SIZE_TO_LSIZE_HI(size); + tp->ctt_lsizelo = CTF_SIZE_TO_LSIZE_LO(size); + } else { + tp->ctt_size = (ushort_t)size; + } + } + /* * Iterate over the members of a STRUCT or UNION. We pass the name, member * type, and offset of each member to the specified callback function. */ int
*** 479,489 **** case CTF_K_FORWARD: return (0); case CTF_K_ENUM: ! return (fp->ctf_dmodel->ctd_int); 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 --- 491,501 ---- case CTF_K_FORWARD: return (0); case CTF_K_ENUM: ! 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,587 **** return (align); } case CTF_K_ENUM: - return (fp->ctf_dmodel->ctd_int); - default: return (ctf_get_ctt_size(fp, tp, NULL, NULL)); } } --- 588,597 ----