summaryrefslogtreecommitdiff
path: root/codegen
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2019-01-14 17:27:52 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2019-01-14 17:29:10 +0100
commit7f2ad3b38a8455d4cbfa10f639cd8380fec7e035 (patch)
tree8f4c9d607dae984f937690aad5c1f9a2026096b2 /codegen
parente82cafa720da4003c3d5034d9de1f94a943e508f (diff)
downloadvala-7f2ad3b38a8455d4cbfa10f639cd8380fec7e035.tar.gz
codegen: Only set "sentinel" CCode attribute for node if requested
This should restrict this being set only on Method nodes.
Diffstat (limited to 'codegen')
-rw-r--r--codegen/valaccodeattribute.vala19
1 files changed, 14 insertions, 5 deletions
diff --git a/codegen/valaccodeattribute.vala b/codegen/valaccodeattribute.vala
index 52ef9a01c..0dba3a99b 100644
--- a/codegen/valaccodeattribute.vala
+++ b/codegen/valaccodeattribute.vala
@@ -597,10 +597,22 @@ public class Vala.CCodeAttribute : AttributeCache {
}
}
+ public string sentinel {
+ get {
+ if (_sentinel == null) {
+ if (ccode != null) {
+ _sentinel = ccode.get_string ("sentinel", "NULL");
+ } else {
+ _sentinel = "NULL";
+ }
+ }
+ return _sentinel;
+ }
+ }
+
public string? array_length_type { get; private set; }
public string? array_length_name { get; private set; }
public string? array_length_expr { get; private set; }
- public string sentinel { get; private set; }
private string _name;
private string _const_name;
@@ -647,6 +659,7 @@ public class Vala.CCodeAttribute : AttributeCache {
private bool ctype_set = false;
private bool? _array_length;
private bool? _array_null_terminated;
+ private string _sentinel;
private static int dynamic_method_id;
@@ -659,10 +672,6 @@ public class Vala.CCodeAttribute : AttributeCache {
array_length_type = ccode.get_string ("array_length_type");
array_length_name = ccode.get_string ("array_length_cname");
array_length_expr = ccode.get_string ("array_length_cexpr");
- sentinel = ccode.get_string ("sentinel");
- }
- if (sentinel == null) {
- sentinel = "NULL";
}
}