aboutsummaryrefslogtreecommitdiff
path: root/backendC/CleanCompilerSources
diff options
context:
space:
mode:
authorronny2004-04-19 14:19:38 +0000
committerronny2004-04-19 14:19:38 +0000
commit46d10df341f0c1bbc5452dabea0210b2599039bb (patch)
tree260fde8c24e404fb771bc86df45dd91d6db8ebd4 /backendC/CleanCompilerSources
parentmark lazy and/or curried entries of cons for list of unboxed records (diff)
remove TC; types
type constructors in dynamic types are now uniquely represented by the descriptor of their TD_ (type definition) function git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1486 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'backendC/CleanCompilerSources')
-rw-r--r--backendC/CleanCompilerSources/backend.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/backendC/CleanCompilerSources/backend.c b/backendC/CleanCompilerSources/backend.c
index 6571c4b..07d18b4 100644
--- a/backendC/CleanCompilerSources/backend.c
+++ b/backendC/CleanCompilerSources/backend.c
@@ -502,7 +502,10 @@ BEDeclareModules (int nModules)
gBEState.be_modules = (BEModuleP) ConvertAlloc (nModules * sizeof (BEModuleS));
for (i = 0; i < nModules; i++)
+ {
gBEState.be_modules [i].bem_name = NULL;
+ gBEState.be_modules [i].bem_nFunctions = 0;
+ }
} /* BEDeclareModules */
BESymbolP
@@ -3431,15 +3434,21 @@ BEExportFunction (int functionIndex)
dclModule = &gBEState.be_icl.beicl_dcl_module;
- Assert ((unsigned int) functionIndex < dclModule->bem_nFunctions);
- functionSymbol = &dclModule->bem_functions [functionIndex];
- Assert (functionSymbol->symb_kind == definition);
- dclDef = functionSymbol->symb_def;
+ if (((unsigned int) functionIndex < dclModule->bem_nFunctions))
+ {
+ functionSymbol = &dclModule->bem_functions [functionIndex];
+ Assert (functionSymbol->symb_kind == definition);
+ dclDef = functionSymbol->symb_def;
+
+ dclDef->sdef_dcl_icl = iclDef;
+
+ Assert (strcmp (iclDef->sdef_ident->ident_name, dclDef->sdef_ident->ident_name) == 0);
+ }
+ else
+ dclDef = NULL;
- Assert (strcmp (iclDef->sdef_ident->ident_name, dclDef->sdef_ident->ident_name) == 0);
iclDef->sdef_dcl_icl = dclDef;
- dclDef->sdef_dcl_icl = iclDef;
iclDef->sdef_exported = True;
} /* BEExportFunction */