summaryrefslogtreecommitdiff
path: root/rts/Linker.c
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-11-23 18:12:15 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-11-30 10:15:58 -0500
commit9f4efa6a5e5d43c81d7e61b27f7cd6e3f812b1ea (patch)
treed27d4cde95297f4d6dae0e08005caaf8ce40050f /rts/Linker.c
parentb66292890d5fe0791c291f4fc427f1ab1d0f5c15 (diff)
downloadhaskell-9f4efa6a5e5d43c81d7e61b27f7cd6e3f812b1ea.tar.gz
rts/linker: Replace some ASSERTs with CHECK
In the past some people have confused ASSERT, which is for checking internal invariants, which CHECK, which should be used when checking things that might fail due to bad input (and therefore should be enabled even in the release compiler). Change some of these cases in the linker to use CHECK.
Diffstat (limited to 'rts/Linker.c')
-rw-r--r--rts/Linker.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/rts/Linker.c b/rts/Linker.c
index 96d25fb741..9defb1efa0 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -49,7 +49,6 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
-#include <assert.h>
#include <fs_rts.h>
#if defined(HAVE_SYS_STAT_H)
@@ -885,12 +884,11 @@ SymbolAddr* lookupDependentSymbol (SymbolName* lbl, ObjectCode *dependent)
*/
IF_DEBUG(linker, debugBelch("lookupSymbol: looking up %s with dlsym\n",
lbl));
- ASSERT(lbl[0] == '_');
+ CHECK(lbl[0] == '_');
return internal_dlsym(lbl + 1);
# else
- ASSERT(false);
- return NULL;
+# error No OBJFORMAT_* macro set
# endif
} else {
if (dependent) {
@@ -2112,7 +2110,7 @@ HsInt unloadNativeObj (void *handle)
n_unloaded_objects += 1;
// dynamic objects have no symbols
- ASSERT(nc->symbols == NULL);
+ CHECK(nc->symbols == NULL);
freeOcStablePtrs(nc);
// Remove object code from root set