summaryrefslogtreecommitdiff
path: root/codegen/valaccodememberaccessmodule.vala
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2010-10-09 16:39:44 +0200
committerJürg Billeter <j@bitron.ch>2010-10-09 18:12:17 +0200
commitfe0b6648c9a1bc92fae91ec180e17b64dcbc85f3 (patch)
treed1d82bfa009f3175ba440cdf5835394b5be2e536 /codegen/valaccodememberaccessmodule.vala
parent60f3d89c3aee1082fcdb086cb20963251616b952 (diff)
downloadvala-fe0b6648c9a1bc92fae91ec180e17b64dcbc85f3.tar.gz
codegen: Use append_array_size for local variable access
Diffstat (limited to 'codegen/valaccodememberaccessmodule.vala')
-rw-r--r--codegen/valaccodememberaccessmodule.vala10
1 files changed, 10 insertions, 0 deletions
diff --git a/codegen/valaccodememberaccessmodule.vala b/codegen/valaccodememberaccessmodule.vala
index a2c7646e3..fb8d08599 100644
--- a/codegen/valaccodememberaccessmodule.vala
+++ b/codegen/valaccodememberaccessmodule.vala
@@ -355,8 +355,18 @@ public class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
// captured variables are stored on the heap
var block = (Block) local.parent_symbol;
set_cvalue (expr, new CCodeMemberAccess.pointer (get_variable_cexpression ("_data%d_".printf (get_block_id (block))), get_variable_cname (local.name)));
+ if (array_type != null) {
+ for (int dim = 1; dim <= array_type.rank; dim++) {
+ append_array_size (expr, new CCodeMemberAccess.pointer (get_variable_cexpression ("_data%d_".printf (get_block_id (block))), get_array_length_cname (get_variable_cname (local.name), dim)));
+ }
+ }
} else {
set_cvalue (expr, get_variable_cexpression (local.name));
+ if (array_type != null) {
+ for (int dim = 1; dim <= array_type.rank; dim++) {
+ append_array_size (expr, get_variable_cexpression (get_array_length_cname (get_variable_cname (local.name), dim)));
+ }
+ }
if (expr.parent_node is ReturnStatement &&
current_return_type.value_owned &&