vala r2025 - in trunk: . vala
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r2025 - in trunk: . vala
- Date: Mon, 17 Nov 2008 20:26:54 +0000 (UTC)
Author: juergbi
Date: Mon Nov 17 20:26:54 2008
New Revision: 2025
URL: http://svn.gnome.org/viewvc/vala?rev=2025&view=rev
Log:
2008-11-17 JÃrg Billeter <j bitron ch>
* vala/valacatchclause.vala:
* vala/valacreationmethod.vala:
* vala/valafield.vala:
* vala/valaforeachstatement.vala:
* vala/valamemberaccess.vala:
* vala/valamethod.vala:
Ensure that members are checked when accessing them,
fixes bug 561018
Modified:
trunk/ChangeLog
trunk/vala/valacatchclause.vala
trunk/vala/valacreationmethod.vala
trunk/vala/valafield.vala
trunk/vala/valaforeachstatement.vala
trunk/vala/valamemberaccess.vala
trunk/vala/valamethod.vala
Modified: trunk/vala/valacatchclause.vala
==============================================================================
--- trunk/vala/valacatchclause.vala (original)
+++ trunk/vala/valacatchclause.vala Mon Nov 17 20:26:54 2008
@@ -109,6 +109,8 @@
body.scope.add (variable_name, error_variable);
body.add_local_variable (error_variable);
+
+ error_variable.checked = true;
} else {
error_type = new ErrorType (null, null, source_reference);
}
Modified: trunk/vala/valacreationmethod.vala
==============================================================================
--- trunk/vala/valacreationmethod.vala (original)
+++ trunk/vala/valacreationmethod.vala Mon Nov 17 20:26:54 2008
@@ -131,10 +131,21 @@
return false;
}
+ var old_source_file = analyzer.current_source_file;
var old_symbol = analyzer.current_symbol;
+ var old_class = analyzer.current_class;
+ var old_struct = analyzer.current_struct;
var old_return_type = analyzer.current_return_type;
+ if (source_reference != null) {
+ analyzer.current_source_file = source_reference.file;
+ }
analyzer.current_symbol = this;
+ if (parent_symbol is Class) {
+ analyzer.current_class = (Class) parent_symbol;
+ } else if (parent_symbol is Struct) {
+ analyzer.current_struct = (Struct) parent_symbol;
+ }
analyzer.current_return_type = return_type;
foreach (FormalParameter param in get_parameters()) {
@@ -149,7 +160,10 @@
body.check (analyzer);
}
+ analyzer.current_source_file = old_source_file;
analyzer.current_symbol = old_symbol;
+ analyzer.current_class = old_class;
+ analyzer.current_struct = old_struct;
analyzer.current_return_type = old_return_type;
if (analyzer.current_symbol.parent_symbol is Method) {
Modified: trunk/vala/valafield.vala
==============================================================================
--- trunk/vala/valafield.vala (original)
+++ trunk/vala/valafield.vala Mon Nov 17 20:26:54 2008
@@ -203,6 +203,12 @@
checked = true;
+ var old_source_file = analyzer.current_source_file;
+
+ if (source_reference != null) {
+ analyzer.current_source_file = source_reference.file;
+ }
+
field_type.check (analyzer);
process_attributes ();
@@ -239,6 +245,8 @@
analyzer.current_source_file.add_type_dependency (field_type, SourceFileDependencyType.SOURCE);
}
+ analyzer.current_source_file = old_source_file;
+
return !error;
}
}
Modified: trunk/vala/valaforeachstatement.vala
==============================================================================
--- trunk/vala/valaforeachstatement.vala (original)
+++ trunk/vala/valaforeachstatement.vala Mon Nov 17 20:26:54 2008
@@ -223,6 +223,7 @@
body.add_local_variable (element_variable);
element_variable.active = true;
+ element_variable.checked = true;
// analyze body
owner = analyzer.current_symbol.scope;
Modified: trunk/vala/valamemberaccess.vala
==============================================================================
--- trunk/vala/valamemberaccess.vala (original)
+++ trunk/vala/valamemberaccess.vala Mon Nov 17 20:26:54 2008
@@ -395,6 +395,11 @@
var access = SymbolAccessibility.PUBLIC;
bool instance = false;
bool klass = false;
+
+ if (!member.check (analyzer)) {
+ return false;
+ }
+
if (member is Field) {
var f = (Field) member;
access = f.access;
Modified: trunk/vala/valamethod.vala
==============================================================================
--- trunk/vala/valamethod.vala (original)
+++ trunk/vala/valamethod.vala Mon Nov 17 20:26:54 2008
@@ -649,9 +649,21 @@
Report.error (source_reference, "Non-abstract, non-extern methods must have bodies");
}
+ var old_source_file = analyzer.current_source_file;
var old_symbol = analyzer.current_symbol;
+ var old_class = analyzer.current_class;
+ var old_struct = analyzer.current_struct;
var old_return_type = analyzer.current_return_type;
+
+ if (source_reference != null) {
+ analyzer.current_source_file = source_reference.file;
+ }
analyzer.current_symbol = this;
+ if (parent_symbol is Class) {
+ analyzer.current_class = (Class) parent_symbol;
+ } else if (parent_symbol is Struct) {
+ analyzer.current_struct = (Struct) parent_symbol;
+ }
analyzer.current_return_type = return_type;
return_type.check (analyzer);
@@ -698,7 +710,10 @@
body.check (analyzer);
}
+ analyzer.current_source_file = old_source_file;
analyzer.current_symbol = old_symbol;
+ analyzer.current_class = old_class;
+ analyzer.current_struct = old_struct;
analyzer.current_return_type = old_return_type;
if (analyzer.current_symbol.parent_symbol is Method) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]