[vala] codegen: Use append_array_size for array creation expressions
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] codegen: Use append_array_size for array creation expressions
- Date: Sat, 9 Oct 2010 17:07:36 +0000 (UTC)
commit 56a6fad4cc5075c3d7ecae0cbdf33b806a49de24
Author: Jürg Billeter <j bitron ch>
Date: Sat Oct 9 16:03:27 2010 +0200
codegen: Use append_array_size for array creation expressions
codegen/valaccodearraymodule.vala | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/codegen/valaccodearraymodule.vala b/codegen/valaccodearraymodule.vala
index 276f5c7..09772cb 100644
--- a/codegen/valaccodearraymodule.vala
+++ b/codegen/valaccodearraymodule.vala
@@ -83,6 +83,10 @@ public class Vala.CCodeArrayModule : CCodeMethodCallModule {
emit_temp_var (temp_var);
csize = new CCodeAssignment (name_cnode, csize);
+
+ append_array_size (expr, name_cnode);
+ } else {
+ append_array_size (expr, csize);
}
if (first) {
@@ -171,11 +175,7 @@ public class Vala.CCodeArrayModule : CCodeMethodCallModule {
array_expr = reftransfer_expr.inner;
}
- if (array_expr is ArrayCreationExpression) {
- List<Expression> size = ((ArrayCreationExpression) array_expr).get_sizes ();
- var length_expr = size[dim - 1];
- return (CCodeExpression) get_ccodenode (length_expr);
- } else if (array_expr is MethodCall || array_expr is CastExpression || array_expr is SliceExpression) {
+ if (array_expr is ArrayCreationExpression || array_expr is MethodCall || array_expr is CastExpression || array_expr is SliceExpression) {
List<CCodeExpression> size = get_array_sizes (array_expr);
if (size != null && size.size >= dim) {
return size[dim - 1];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]