diff options
author | Ulrich Küttler <kuettler@gmail.com> | 2020-12-22 08:59:16 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-12-22 10:53:10 +0100 |
commit | 462fdc23f804fe7c5d355c3c593ace7303eb15a4 (patch) | |
tree | 57dda019a1512789b572cf0441349c9adf79d2ce /vala/valasliceexpression.vala | |
parent | df7a984607f55338ff2dde6f2fd324dc363a46b4 (diff) | |
download | vala-462fdc23f804fe7c5d355c3c593ace7303eb15a4.tar.gz |
vala: SliceExpression need to return heap-allocated or unowned references
Fixes https://gitlab.gnome.org/GNOME/vala/issues/1120
Diffstat (limited to 'vala/valasliceexpression.vala')
-rw-r--r-- | vala/valasliceexpression.vala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/vala/valasliceexpression.vala b/vala/valasliceexpression.vala index 8eca80998..a9502b3e8 100644 --- a/vala/valasliceexpression.vala +++ b/vala/valasliceexpression.vala @@ -147,6 +147,13 @@ public class Vala.SliceExpression : Expression { if (container.value_type is ArrayType) { value_type = container.value_type.copy (); value_type.value_owned = false; + + // inline allocated results are not compatible with non-constant start/stop expressions + unowned ArrayType array_type = (ArrayType) value_type; + array_type.fixed_length = false; + array_type.inline_allocated = false; + array_type.length = null; + value_type.check (context); /* check if the index is of type integer */ |