[vala] Fix crash with nested lambda expressions
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Subject: [vala] Fix crash with nested lambda expressions
- Date: Mon, 30 Mar 2009 13:31:02 -0400 (EDT)
commit b28d713d6ec4e5be612c983b2085f962f2871f0e
Author: Jürg Billeter <j bitron ch>
Date: Mon Mar 30 19:29:34 2009 +0200
Fix crash with nested lambda expressions
Fixes bug 570872.
---
vala/valalambdaexpression.vala | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/vala/valalambdaexpression.vala b/vala/valalambdaexpression.vala
index 042df58..37c5fb7 100644
--- a/vala/valalambdaexpression.vala
+++ b/vala/valalambdaexpression.vala
@@ -137,6 +137,25 @@ public class Vala.LambdaExpression : Expression {
method = new Method (get_lambda_name (analyzer), cb.return_type);
if (!cb.has_target || !analyzer.is_in_instance_method ()) {
method.binding = MemberBinding.STATIC;
+ } else {
+ var sym = analyzer.current_symbol;
+ while (method.this_parameter == null) {
+ if (sym is Property) {
+ var prop = (Property) sym;
+ method.this_parameter = prop.this_parameter;
+ } else if (sym is Constructor) {
+ var c = (Constructor) sym;
+ method.this_parameter = c.this_parameter;
+ } else if (sym is Destructor) {
+ var d = (Destructor) sym;
+ method.this_parameter = d.this_parameter;
+ } else if (sym is Method) {
+ var m = (Method) sym;
+ method.this_parameter = m.this_parameter;
+ }
+
+ sym = sym.parent_symbol;
+ }
}
method.owner = analyzer.current_symbol.scope;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]