[vala] Fix symbol resolution and enable control flow analysis for signals
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] Fix symbol resolution and enable control flow analysis for signals
- Date: Sun, 19 Dec 2010 15:06:58 +0000 (UTC)
commit d9d9acc6b71331b883c0142ec357843587aa6e36
Author: Luca Bruno <lucabru src gnome org>
Date: Fri Dec 17 22:39:31 2010 +0100
Fix symbol resolution and enable control flow analysis for signals
Fixes bug 635820.
vala/valaflowanalyzer.vala | 6 ++++++
vala/valasignal.vala | 4 +++-
2 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/vala/valaflowanalyzer.vala b/vala/valaflowanalyzer.vala
index 010c443..c57ade7 100644
--- a/vala/valaflowanalyzer.vala
+++ b/vala/valaflowanalyzer.vala
@@ -176,6 +176,12 @@ public class Vala.FlowAnalyzer : CodeVisitor {
visit_subroutine (m);
}
+ public override void visit_signal (Signal sig) {
+ if (sig.default_handler != null) {
+ visit_subroutine (sig.default_handler);
+ }
+ }
+
void visit_subroutine (Subroutine m) {
if (m.body == null) {
return;
diff --git a/vala/valasignal.vala b/vala/valasignal.vala
index 6530c44..a2ed64a 100644
--- a/vala/valasignal.vala
+++ b/vala/valasignal.vala
@@ -205,7 +205,9 @@ public class Vala.Signal : Symbol, Lockable {
foreach (Parameter param in parameters) {
param.accept (visitor);
}
- if (default_handler != null) {
+ if (default_handler == null && body != null) {
+ body.accept (visitor);
+ } else if (default_handler != null) {
default_handler.accept (visitor);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]