vala r1918 - in trunk: . vala



Author: juergbi
Date: Sat Oct 25 12:51:02 2008
New Revision: 1918
URL: http://svn.gnome.org/viewvc/vala?rev=1918&view=rev

Log:
2008-10-25  JÃrg Billeter  <j bitron ch>

	* vala/valasemanticanalyzer.vala:
	* vala/valasourcefile.vala:

	Fix crash on certain header dependencies, fixes bug 546183


Modified:
   trunk/ChangeLog
   trunk/vala/valasemanticanalyzer.vala
   trunk/vala/valasourcefile.vala

Modified: trunk/vala/valasemanticanalyzer.vala
==============================================================================
--- trunk/vala/valasemanticanalyzer.vala	(original)
+++ trunk/vala/valasemanticanalyzer.vala	Sat Oct 25 12:51:02 2008
@@ -411,7 +411,11 @@
 		}
 
 		if (!f.is_internal_symbol ()) {
-			current_source_file.add_type_dependency (f.field_type, SourceFileDependencyType.HEADER_SHALLOW);
+			if (f.field_type is ValueType) {
+				current_source_file.add_type_dependency (f.field_type, SourceFileDependencyType.HEADER_FULL);
+			} else {
+				current_source_file.add_type_dependency (f.field_type, SourceFileDependencyType.HEADER_SHALLOW);
+			}
 		} else {
 			if (f.parent_symbol is Namespace) {
 				f.error = true;
@@ -478,7 +482,11 @@
 		}
 
 		if (!m.is_internal_symbol ()) {
-			current_source_file.add_type_dependency (m.return_type, SourceFileDependencyType.HEADER_SHALLOW);
+			if (m.return_type is ValueType) {
+				current_source_file.add_type_dependency (m.return_type, SourceFileDependencyType.HEADER_FULL);
+			} else {
+				current_source_file.add_type_dependency (m.return_type, SourceFileDependencyType.HEADER_SHALLOW);
+			}
 		}
 		current_source_file.add_type_dependency (m.return_type, SourceFileDependencyType.SOURCE);
 
@@ -598,7 +606,11 @@
 
 		if (!p.ellipsis) {
 			if (!p.is_internal_symbol ()) {
-				current_source_file.add_type_dependency (p.parameter_type, SourceFileDependencyType.HEADER_SHALLOW);
+				if (p.parameter_type is ValueType && !p.parameter_type.is_real_struct_type ()) {
+					current_source_file.add_type_dependency (p.parameter_type, SourceFileDependencyType.HEADER_FULL);
+				} else {
+					current_source_file.add_type_dependency (p.parameter_type, SourceFileDependencyType.HEADER_SHALLOW);
+				}
 			}
 			current_source_file.add_type_dependency (p.parameter_type, SourceFileDependencyType.SOURCE);
 
@@ -655,7 +667,11 @@
 		current_symbol = current_symbol.parent_symbol;
 
 		if (!prop.is_internal_symbol ()) {
-			current_source_file.add_type_dependency (prop.property_type, SourceFileDependencyType.HEADER_SHALLOW);
+			if (prop.property_type is ValueType && !prop.property_type.is_real_struct_type ()) {
+				current_source_file.add_type_dependency (prop.property_type, SourceFileDependencyType.HEADER_FULL);
+			} else {
+				current_source_file.add_type_dependency (prop.property_type, SourceFileDependencyType.HEADER_SHALLOW);
+			}
 		}
 		current_source_file.add_type_dependency (prop.property_type, SourceFileDependencyType.SOURCE);
 

Modified: trunk/vala/valasourcefile.vala
==============================================================================
--- trunk/vala/valasourcefile.vala	(original)
+++ trunk/vala/valasourcefile.vala	Sat Oct 25 12:51:02 2008
@@ -314,7 +314,7 @@
 			return;
 		}
 		
-		if (dep_type == SourceFileDependencyType.HEADER_FULL || (s is TypeSymbol && !((TypeSymbol)s).is_reference_type ())) {
+		if (dep_type == SourceFileDependencyType.HEADER_FULL) {
 			foreach (string fn in s.get_cheader_filenames ()) {
 				header_internal_includes.add (fn);
 			}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]