[project @ 2001-02-12 12:22:01 by simonmar]
authorsimonmar <unknown>
Mon, 12 Feb 2001 12:22:01 +0000 (12:22 +0000)
committersimonmar <unknown>
Mon, 12 Feb 2001 12:22:01 +0000 (12:22 +0000)
add some assertions

ghc/rts/Linker.c

index 940f39e..4f2a456 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Linker.c,v 1.22 2001/02/11 17:51:07 simonmar Exp $
+ * $Id: Linker.c,v 1.23 2001/02/12 12:22:01 simonmar Exp $
  *
  * (c) The GHC Team, 2000
  *
@@ -285,6 +285,7 @@ void *
 lookupSymbol( char *lbl )
 {
     SymbolVal *val;
+    ASSERT(symhash != NULL);
     val = lookupStrHashTable(symhash, lbl);
 
     if (val == NULL) {
@@ -415,6 +416,9 @@ unloadObj( char *path )
 {
     ObjectCode *oc, *prev;
 
+    ASSERT(symhash != NULL);
+    ASSERT(objects != NULL);
+
     prev = NULL;
     for (oc = objects; oc; prev = oc, oc = oc->next) {
        if (!strcmp(oc->fileName,path)) {
@@ -1290,6 +1294,8 @@ ocGetNames_ELF ( ObjectCode* oc )
    Elf32_Shdr* shdr       = (Elf32_Shdr*) (ehdrC + ehdr->e_shoff);
    char*       sh_strtab  = ehdrC + shdr[ehdr->e_shstrndx].sh_offset;
 
+   ASSERT(symhash != NULL);
+
    if (!strtab) {
       belch("ocGetNames_ELF: no strtab");
       return 0;