summaryrefslogtreecommitdiff
path: root/rts/Linker.c
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-11-23 18:12:15 -0500
committerBen Gamari <ben@smart-cactus.org>2020-11-27 13:22:47 -0500
commit0946529c941194902e7944d54cc3571301d6bf5f (patch)
treeed2683ab90da4d39799b6d70dff023cbe9df9e10 /rts/Linker.c
parent32a4d677e5bc3bb006bf180a5d095101485e0f21 (diff)
downloadhaskell-wip/no-assert.tar.gz
rts/linker: Replace some ASSERTs with CHECKwip/no-assert
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