PR# 17237 Invalid shared library definition file for system with generic root crashes compiler

Problem Report Summary
Submitter: prestoat2000
Category: Compiler
Priority: Medium
Date: 2010/12/22
Class: Bug
Severity: Serious
Number: 17237
Release: 6.7.85123
Confidential: No
Status: Analyzed
Responsible:
Environment: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.1.8) Gecko/20100226 Firefox/3.5.8 Opensolaris on x86
Synopsis: Invalid shared library definition file for system with generic root crashes compiler

Description
A system whose root class is generic and whose configuration file has a
shared library definition that lists the class as non-generic crashes the
compiler with a call on Void target in
{AUXILIARY_FILES}.generate_dynamic_lib_file.

Added eweasel test term197 for this bug.
To Reproduce
Run eweasel test term197.
Problem Report Interactions
From:prestoat2000    Date:2011/08/05    Status: Analyzed    Download   
Test term197 fails with 7.0.86929.  Reopening.

From:manus_eiffel    Date:2011/06/09    Status: Closed    Download   
Added this to rev#86683.

From:manus_eiffel    Date:2011/06/09    Status: Analyzed    Download   
Actually the query to use was `dl_class.has_types'.

From:prestoat2000    Date:2011/06/09    Download   
Since the Dynamic Library Builder does not support generic classes, a
line in the shared library definition file that names a generic class should
probably be ignored, rather than crashing the compiler.

The bug seems to be in {E_DYNAMIC_LIB}.add_export_feature_from_file
(or in called routine `add_export_feature', depending on where you want to
fix it).

The svn diff for one proposed fix is (with lines shifted left for
readability):

--- /home/eiffel/svn/trunk/Src/Eiffel/API/interface/e_dynamic_lib.e     (revision 86670)
+++ /home/eiffel/svn/trunk/Src/Eiffel/API/interface/e_dynamic_lib.e     (working copy)
@@ -201,7 +201,7 @@

      if class_i /= Void then
              dl_class := class_i.compiled_class
-             if not dl_class.is_precompiled then
+             if not dl_class.is_precompiled and dl_class.actual_type.has_associated_class_type (Void) then
                  api_feature_table:= dl_class.api_feature_table
                  if api_feature_table.has_key (t_routine) then
  
....
Output truncated, Click download to get the full message