projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7954c50
)
[project @ 2001-02-12 12:22:01 by simonmar]
author
simonmar
<unknown>
Mon, 12 Feb 2001 12:22:01 +0000
(12:22 +0000)
committer
simonmar
<unknown>
Mon, 12 Feb 2001 12:22:01 +0000
(12:22 +0000)
add some assertions
ghc/rts/Linker.c
patch
|
blob
|
history
diff --git
a/ghc/rts/Linker.c
b/ghc/rts/Linker.c
index
940f39e
..
4f2a456
100644
(file)
--- 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
*
*
* (c) The GHC Team, 2000
*
@@
-285,6
+285,7
@@
void *
lookupSymbol( char *lbl )
{
SymbolVal *val;
lookupSymbol( char *lbl )
{
SymbolVal *val;
+ ASSERT(symhash != NULL);
val = lookupStrHashTable(symhash, lbl);
if (val == NULL) {
val = lookupStrHashTable(symhash, lbl);
if (val == NULL) {
@@
-415,6
+416,9
@@
unloadObj( char *path )
{
ObjectCode *oc, *prev;
{
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)) {
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;
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;
if (!strtab) {
belch("ocGetNames_ELF: no strtab");
return 0;