Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351749 - Invalid module recursion detection: leads to stack overflow
Summary: Invalid module recursion detection: leads to stack overflow
Status: CLOSED FIXED
Alias: None
Product: Acceleo
Classification: Modeling
Component: Core (show other bugs)
Version: 3.1.0   Edit
Hardware: All All
: P3 normal
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-11 15:58 EDT by Pavel Moravec CLA
Modified: 2011-08-18 04:21 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.