[vala] Respect accessibility of creation methods
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vala] Respect accessibility of creation methods
- Date: Sun, 16 Aug 2009 15:26:50 +0000 (UTC)
commit ec5a591a714d9ad0ecb04f969a703ffb0b2e5bec
Author: Jürg Billeter <j bitron ch>
Date: Sun Aug 16 17:06:50 2009 +0200
Respect accessibility of creation methods
Fixes bug 560974.
vala/valaobjectcreationexpression.vala | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/vala/valaobjectcreationexpression.vala b/vala/valaobjectcreationexpression.vala
index 763c5a4..860ccf7 100644
--- a/vala/valaobjectcreationexpression.vala
+++ b/vala/valaobjectcreationexpression.vala
@@ -256,6 +256,22 @@ public class Vala.ObjectCreationExpression : Expression {
}
}
+ if (symbol_reference != null && symbol_reference.access == SymbolAccessibility.PRIVATE) {
+ bool in_target_type = false;
+ for (Symbol this_symbol = analyzer.current_symbol; this_symbol != null; this_symbol = this_symbol.parent_symbol) {
+ if (this_symbol == cl) {
+ in_target_type = true;
+ break;
+ }
+ }
+
+ if (!in_target_type) {
+ error = true;
+ Report.error (source_reference, "Access to private member `%s' denied".printf (symbol_reference.get_full_name ()));
+ return false;
+ }
+ }
+
while (cl != null) {
if (cl.get_ref_sink_function () != null) {
value_type.floating_reference = true;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]