diff options
author | ronny | 2002-02-15 14:17:33 +0000 |
---|---|---|
committer | ronny | 2002-02-15 14:17:33 +0000 |
commit | 4144fda7ff5dcc17f408a17102fa828ae5e70702 (patch) | |
tree | 2044e55b9e8e1c685568e7bb0be257a568619caa | |
parent | backend.c (diff) |
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
-rw-r--r-- | backendC/CleanCompilerSources/instructions.c | 15 |
1 files changed, 11 insertions, 4 deletions
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; |