point to the unimplemented type, for now, because the compiler can emit
such slices, though they're not very much use. */
- resolved_ref = ctf_type_resolve_unsliced (fp, ref);
+ if ((resolved_ref = ctf_type_resolve_unsliced (fp, ref)) == CTF_ERR)
+ return CTF_ERR; /* errno is set for us. */
kind = ctf_type_kind_unsliced (fp, resolved_ref);
if ((kind != CTF_K_INTEGER) && (kind != CTF_K_FLOAT) &&
ctf_id_t type, unsigned long bit_offset)
{
ctf_dict_t *ofp = fp;
+ ctf_dict_t *tmp = fp;
ctf_dtdef_t *dtd = ctf_dtd_lookup (fp, souid);
ssize_t msize, malign, ssize;
if (dtd == NULL)
return (ctf_set_errno (ofp, ECTF_BADID));
+ if ((ctf_lookup_by_id (&tmp, type)) == NULL)
+ return -1; /* errno is set for us. */
+
if (name != NULL && name[0] == '\0')
name = NULL;
ctf_id_t underlying;
slice = (ctf_slice_t *) vlen;
- underlying = ctf_type_resolve (ofp, slice->cts_type);
+ if ((underlying = ctf_type_resolve (ofp, slice->cts_type)) == CTF_ERR)
+ return -1;
+
if (ctf_type_encoding (ofp, underlying, &underlying_en) < 0)
return -1; /* errno is set for us. */
const ctf_type_t *ltp, *rtp;
ctf_encoding_t le, re;
ctf_arinfo_t la, ra;
- uint32_t lkind, rkind;
+ int lkind, rkind;
int same_names = 0;
if (lfp->ctf_flags & LCTF_NO_STR)
return 1;
ltype = ctf_type_resolve (lfp, ltype);
- lkind = ctf_type_kind (lfp, ltype);
-
rtype = ctf_type_resolve (rfp, rtype);
+
+ if (ltype == CTF_ERR || rtype == CTF_ERR)
+ return -1; /* errno is set for us. */
+
+ lkind = ctf_type_kind (lfp, ltype);
rkind = ctf_type_kind (rfp, rtype);
+ if (lkind < 0 || rkind < 0)
+ return -1; /* errno is set for us. */
+
ltp = ctf_lookup_by_id (&lfp, ltype);
rtp = ctf_lookup_by_id (&rfp, rtype);