From: Gaius Mulley Date: Sun, 4 Dec 2022 19:12:53 +0000 (+0000) Subject: Bugfix the scope name when generating constants. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=071c72a9e43609501648c7c6170329724b0eca39;p=thirdparty%2Fgcc.git Bugfix the scope name when generating constants. A bug occurs when generating an error while constructing constants. The scope name is incorrect. Fixed by changing GetGlobalQuads and moving StartBuildInit after Declaration. gcc/m2/ChangeLog: * gm2-compiler/M2Scope.mod (GetGlobalQuads): Use prev to remember previous block and assign the scope characteristics of the next block with the same as the previous. * gm2-compiler/P0SymBuild.mod (FlushImport): Remove unused variable modname. * gm2-compiler/P3Build.bnf (Block): Move StartBuildInit after the Declaration. Signed-off-by: Gaius Mulley --- diff --git a/gcc/m2/gm2-compiler/M2Quads.mod b/gcc/m2/gm2-compiler/M2Quads.mod index 5de7ddb52813..88a7e7a6aeb8 100644 --- a/gcc/m2/gm2-compiler/M2Quads.mod +++ b/gcc/m2/gm2-compiler/M2Quads.mod @@ -1767,17 +1767,17 @@ VAR f: QuadFrame ; BEGIN QuadNo := FreeList ; - IF InBounds(QuadArray, QuadNo) AND (GetIndice(QuadArray, QuadNo)#NIL) + IF InBounds (QuadArray, QuadNo) AND (GetIndice (QuadArray, QuadNo) # NIL) THEN - f := GetIndice(QuadArray, QuadNo) + f := GetIndice (QuadArray, QuadNo) ELSE - NEW(f) ; + NEW (f) ; IF f=NIL THEN InternalError ('out of memory error trying to allocate a quadruple') ELSE - INC(NoOfQuads) ; - PutIndice(QuadArray, QuadNo, f) ; + INC (NoOfQuads) ; + PutIndice (QuadArray, QuadNo, f) ; f^.NoOfTimesReferenced := 0 END END ; @@ -1786,8 +1786,8 @@ BEGIN Operand3 := 0 ; Next := 0 END ; - INC(FreeList) ; - IF GrowInitialization