From 46d10df341f0c1bbc5452dabea0210b2599039bb Mon Sep 17 00:00:00 2001 From: ronny Date: Mon, 19 Apr 2004 14:19:38 +0000 Subject: 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 --- backendC/CleanCompilerSources/backend.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'backendC/CleanCompilerSources') 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 */ -- cgit v1.2.3