From 4144fda7ff5dcc17f408a17102fa828ae5e70702 Mon Sep 17 00:00:00 2001 From: ronny Date: Fri, 15 Feb 2002 14:17:33 +0000 Subject: initialise number for failing case label for each compile git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1026 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d --- backendC/CleanCompilerSources/instructions.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'backendC') diff --git a/backendC/CleanCompilerSources/instructions.c b/backendC/CleanCompilerSources/instructions.c index a9c2a66..10b1583 100644 --- a/backendC/CleanCompilerSources/instructions.c +++ b/backendC/CleanCompilerSources/instructions.c @@ -1257,6 +1257,9 @@ extern Symbol UnboxedArrayFunctionSymbols []; static Label ApplyLabel; static StateS ApplyState; +#if CLEAN2 +static int CaseFailNumber; +#endif extern SymbDef ApplyDef; /* from codegen2.c */ @@ -3391,9 +3394,9 @@ void GenNoMatchError (SymbDef sdef,int asp,int bsp,int string_already_generated) } #if CLEAN2 + void GenCaseNoMatchError (SymbDefP case_def,int asp,int bsp) { - static int case_number; GenPopA (asp); GenPopB (bsp); @@ -3402,16 +3405,16 @@ void GenCaseNoMatchError (SymbDefP case_def,int asp,int bsp) FPrintF (OutFile, "m_%s", CurrentModule); put_instruction_b (pushD); - FPrintF (OutFile, "case_fail%u",case_number); + FPrintF (OutFile, "case_fail%u",CaseFailNumber); GenJmp (&match_error_lab); put_directive_ (Dstring); - FPrintF (OutFile, "case_fail%u \"",case_number); + FPrintF (OutFile, "case_fail%u \"",CaseFailNumber); PrintSymbolOfIdent (case_def->sdef_ident,case_def->sdef_line,OutFile); FPrintF (OutFile, "\""); - case_number++; + CaseFailNumber++; } #endif @@ -3631,6 +3634,10 @@ void GenImpLib (char *lib_name) void InitInstructions (void) { +#if CLEAN2 + CaseFailNumber = 0; +#endif + ABCFileName = NULL; SetUnaryState (& ApplyState, StrictRedirection, UnknownObj); ApplyLabel = NULL; -- cgit v1.2.3