From 112d184348163d02d49789c3a7453e2ef86a493c Mon Sep 17 00:00:00 2001 From: Gaius Mulley Date: Tue, 19 Nov 2024 15:32:02 +0000 Subject: [PATCH] [PATCH] PR modula2/115003 exporting a symbol to outer scope with a name clash causes ICE An ICE will occur if an unknown symbol is exported and causes a name clash. The error mechanism attempts to find the scope of an unknown symbol. This patch adds a missing case clause to GetScope and returns NulSym if the scope is an unknown symbol. gcc/m2/ChangeLog: PR modula2/115003 * gm2-compiler/SymbolTable.mod (GetScope): Add UndefinedSym case clause and return NulSym. (cherry picked from commit bc5afdf14ccf8375f7fb3de2be1121aaf550f8aa) Signed-off-by: Gaius Mulley --- gcc/m2/gm2-compiler/SymbolTable.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/m2/gm2-compiler/SymbolTable.mod b/gcc/m2/gm2-compiler/SymbolTable.mod index f5890ec684fe..f206a47dff78 100644 --- a/gcc/m2/gm2-compiler/SymbolTable.mod +++ b/gcc/m2/gm2-compiler/SymbolTable.mod @@ -12449,6 +12449,7 @@ BEGIN ConstLitSym : RETURN( ConstLit.Scope ) | ConstStringSym : RETURN( ConstString.Scope ) | ConstVarSym : RETURN( ConstVar.Scope ) | + UndefinedSym : RETURN( NulSym ) | PartialUnboundedSym: InternalError ('should not be requesting the scope of a PartialUnbounded symbol') ELSE -- 2.47.2