From 3cf7519556ab1b4c7aa49094a0a8d73f06828979 Mon Sep 17 00:00:00 2001 From: simonmar Date: Mon, 12 Feb 2001 12:22:01 +0000 Subject: [PATCH] [project @ 2001-02-12 12:22:01 by simonmar] add some assertions --- ghc/rts/Linker.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ghc/rts/Linker.c b/ghc/rts/Linker.c index 940f39e..4f2a456 100644 --- a/ghc/rts/Linker.c +++ b/ghc/rts/Linker.c @@ -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; -- 1.7.10.4