public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-8684] PR modula2/111627 defend against ICE
@ 2024-02-01 10:25 Gaius Mulley
  0 siblings, 0 replies; only message in thread
From: Gaius Mulley @ 2024-02-01 10:25 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:75f49cf82e06971b066b4f440256004775603752

commit r14-8684-g75f49cf82e06971b066b4f440256004775603752
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date:   Thu Feb 1 10:24:02 2024 +0000

    PR modula2/111627 defend against ICE
    
    Although PR 111627 can be fixed by renaming testsuite modules it
    highlighted that a possible ICE can occur if a malformed
    implementation module is actually a program module.  This small
    patch defends against this ICE and checks to see whether the module
    is a DefImp before testing IsDefinitionForC.
    
    gcc/m2/ChangeLog:
    
            PR modula2/111627
            PR modula2/112506
            * gm2-compiler/M2Comp.mod (Pass0CheckMod): Test IsDefImp before
            checking IsDefinitionForC.
    
    Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>

Diff:
---
 gcc/m2/gm2-compiler/M2Comp.mod | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/m2/gm2-compiler/M2Comp.mod b/gcc/m2/gm2-compiler/M2Comp.mod
index a97f0edd648d..c10c301cbde3 100644
--- a/gcc/m2/gm2-compiler/M2Comp.mod
+++ b/gcc/m2/gm2-compiler/M2Comp.mod
@@ -869,7 +869,7 @@ BEGIN
       END
    ELSIF GenModuleList
    THEN
-      IF NOT IsDefinitionForC (sym)
+      IF IsDefImp (sym) AND (NOT IsDefinitionForC (sym))
       THEN
          (* The implementation module is only useful if -fgen-module-list= is
             used (to gather all dependencies).  Note that we do not insist

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-02-01 10:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-01 10:25 [gcc r14-8684] PR modula2/111627 defend against ICE Gaius Mulley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).