aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/tools
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2020-04-28 16:09:28 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2020-04-28 16:09:28 +0000
commit6f63e88c0166ed3e5f2805a9e667c7d24d304cf1 (patch)
tree1075492a7445e6ed269cdf7aad145c30ae799566 /cddl/contrib/opensolaris/tools
parent265cef40f059307ab13719266dd83790fa526d29 (diff)
downloadsrc-6f63e88c0166ed3e5f2805a9e667c7d24d304cf1.tar.gz
src-6f63e88c0166ed3e5f2805a9e667c7d24d304cf1.zip
ctfmerge: Assert that there is enough room for types.
Sponsord by: Dell EMC Differential Revision: https://reviews.freebsd.org/D24537
Notes
Notes: svn path=/head/; revision=360445
Diffstat (limited to 'cddl/contrib/opensolaris/tools')
-rw-r--r--cddl/contrib/opensolaris/tools/ctf/cvt/merge.c8
-rw-r--r--cddl/contrib/opensolaris/tools/ctf/cvt/util.c10
2 files changed, 8 insertions, 10 deletions
diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c b/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c
index 3dc2ad0cbdad..45486ff9c2d2 100644
--- a/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c
+++ b/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c
@@ -452,6 +452,10 @@ map_td_tree_post(tdesc_t *ctdp, tdesc_t **ctdpp __unused, void *private)
if (ed.ed_tgt->t_type == FORWARD && ctdp->t_type != FORWARD) {
int id = mcd->md_tgt->td_nextid++;
+#ifdef __FreeBSD__
+ if (CTF_TYPE_ISCHILD(id))
+ terminate("No room for additional types\n");
+#endif
debug(3, "Creating new defn type %d <%x>\n", id, id);
add_mapping(mcd->md_ta, ctdp->t_id, id);
alist_add(mcd->md_fdida, (void *)(ulong_t)ed.ed_tgt,
@@ -473,6 +477,10 @@ map_td_tree_post(tdesc_t *ctdp, tdesc_t **ctdpp __unused, void *private)
} else {
int id = mcd->md_tgt->td_nextid++;
+#ifdef __FreeBSD__
+ if (CTF_TYPE_ISCHILD(id))
+ terminate("No room for additional types\n");
+#endif
debug(3, "Creating new type %d <%x>\n", id, id);
add_mapping(mcd->md_ta, ctdp->t_id, id);
hash_add(mcd->md_tdtba, ctdp);
diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/util.c b/cddl/contrib/opensolaris/tools/ctf/cvt/util.c
index fb76cbaeb422..87f677b7b81a 100644
--- a/cddl/contrib/opensolaris/tools/ctf/cvt/util.c
+++ b/cddl/contrib/opensolaris/tools/ctf/cvt/util.c
@@ -148,17 +148,7 @@ terminate(const char *format, ...)
if (getenv("CTF_ABORT_ON_TERMINATE") != NULL)
abort();
-#if defined(__FreeBSD__)
-/*
- * For the time being just output the termination message, but don't
- * return an exit status that would cause the build to fail. We need
- * to get as much stuff built as possible before going back and
- * figuring out what is wrong with certain files.
- */
- exit(0);
-#else
exit(1);
-#endif
}
/*PRINTFLIKE1*/