Commit 5597ae38 authored by Ronny Wichers Schreur's avatar Ronny Wichers Schreur

initialise number for failing case label for each compile

parent 790a8ad5
...@@ -1257,6 +1257,9 @@ extern Symbol UnboxedArrayFunctionSymbols []; ...@@ -1257,6 +1257,9 @@ extern Symbol UnboxedArrayFunctionSymbols [];
static Label ApplyLabel; static Label ApplyLabel;
static StateS ApplyState; static StateS ApplyState;
#if CLEAN2
static int CaseFailNumber;
#endif
extern SymbDef ApplyDef; /* from codegen2.c */ extern SymbDef ApplyDef; /* from codegen2.c */
...@@ -3391,9 +3394,9 @@ void GenNoMatchError (SymbDef sdef,int asp,int bsp,int string_already_generated) ...@@ -3391,9 +3394,9 @@ void GenNoMatchError (SymbDef sdef,int asp,int bsp,int string_already_generated)
} }
#if CLEAN2 #if CLEAN2
void GenCaseNoMatchError (SymbDefP case_def,int asp,int bsp) void GenCaseNoMatchError (SymbDefP case_def,int asp,int bsp)
{ {
static int case_number;
GenPopA (asp); GenPopA (asp);
GenPopB (bsp); GenPopB (bsp);
...@@ -3402,16 +3405,16 @@ void GenCaseNoMatchError (SymbDefP case_def,int asp,int bsp) ...@@ -3402,16 +3405,16 @@ void GenCaseNoMatchError (SymbDefP case_def,int asp,int bsp)
FPrintF (OutFile, "m_%s", CurrentModule); FPrintF (OutFile, "m_%s", CurrentModule);
put_instruction_b (pushD); put_instruction_b (pushD);
FPrintF (OutFile, "case_fail%u",case_number); FPrintF (OutFile, "case_fail%u",CaseFailNumber);
GenJmp (&match_error_lab); GenJmp (&match_error_lab);
put_directive_ (Dstring); 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); PrintSymbolOfIdent (case_def->sdef_ident,case_def->sdef_line,OutFile);
FPrintF (OutFile, "\""); FPrintF (OutFile, "\"");
case_number++; CaseFailNumber++;
} }
#endif #endif
...@@ -3631,6 +3634,10 @@ void GenImpLib (char *lib_name) ...@@ -3631,6 +3634,10 @@ void GenImpLib (char *lib_name)
void InitInstructions (void) void InitInstructions (void)
{ {
#if CLEAN2
CaseFailNumber = 0;
#endif
ABCFileName = NULL; ABCFileName = NULL;
SetUnaryState (& ApplyState, StrictRedirection, UnknownObj); SetUnaryState (& ApplyState, StrictRedirection, UnknownObj);
ApplyLabel = NULL; ApplyLabel = NULL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment