From 96f811d752c47eb2027b0722f7ba5a5eff802775 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 23 Sep 2002 03:00:49 +0000 Subject: [PATCH] With dynamic linking, it's possible for the default object format to not load, so error out with message instead of asserting. svn path=/trunk/yasm/; revision=703 --- frontends/yasm/yasm.c | 6 +++++- src/main.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index fb4e9fe5..9c54aeee 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -206,7 +206,11 @@ main(int argc, char *argv[]) /* If not already specified, default to dbg as the object format. */ if (!cur_objfmt) cur_objfmt = find_objfmt("dbg"); - assert(cur_objfmt != NULL); + + if (!cur_objfmt) { + ErrorNow(_("Could not load default object format")); + return EXIT_FAILURE; + } /* handle preproc-only case here */ if (preproc_only) { diff --git a/src/main.c b/src/main.c index fb4e9fe5..9c54aeee 100644 --- a/src/main.c +++ b/src/main.c @@ -206,7 +206,11 @@ main(int argc, char *argv[]) /* If not already specified, default to dbg as the object format. */ if (!cur_objfmt) cur_objfmt = find_objfmt("dbg"); - assert(cur_objfmt != NULL); + + if (!cur_objfmt) { + ErrorNow(_("Could not load default object format")); + return EXIT_FAILURE; + } /* handle preproc-only case here */ if (preproc_only) { -- 2.40.0