]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR modula2/115003 exporting a symbol to outer scope with a name clash causes ICE
authorGaius Mulley <gaiusmod2@gmail.com>
Thu, 9 May 2024 18:35:20 +0000 (19:35 +0100)
committerGaius Mulley <gaiusmod2@gmail.com>
Thu, 9 May 2024 18:35:20 +0000 (19:35 +0100)
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.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/m2/gm2-compiler/SymbolTable.mod

index f5890ec684fe1c45c662f8aa00746119b4285341..f206a47dff78ce54960370e0572bd9eaba4a5203 100644 (file)
@@ -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