Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 351749

Summary: Invalid module recursion detection: leads to stack overflow
Product: [Modeling] Acceleo Reporter: Pavel Moravec <pavel.moravec>
Component: CoreAssignee: Project Inbox <acceleo-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: stephane.begaudeau
Version: 3.1.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Pavel Moravec CLA 2011-07-11 15:58:16 EDT
Let's assume three modules: A.mtl, B.mtl and C.mtl and let A is a toplevel module and imports B, B imports C and C imports B. Then method CST2ASTConverterWithResolver.isRecursiveImports finishes by stack overflow exception when checking module A, because it does not detect recursion between B and C. It only tries to detect recursion for A.

One easy solution is to hold all already reached modules in a set, starting with the toplevel module, and detect if imported modules are in the set or not.
Comment 1 Stephane Begaudeau CLA 2011-07-19 08:36:51 EDT
A fix has been contributed on R3_1_maintenance, it will be available in Acceleo 3.1.1.
Comment 2 Laurent Goubet CLA 2011-08-18 04:21:56 EDT
Closing our "resolved" and "verified" bugs.