2008-04-07 Juerg Billeter <j@bitron.ch>
* gobject/valaccodeassignmentbinding.vala: fix element access
assignment with pointers, fixes bug 519933
* tests/pointers.vala: test pointer element access
svn path=/trunk/; revision=1170
+2008-04-07 Jürg Billeter <j@bitron.ch>
+
+ * gobject/valaccodeassignmentbinding.vala: fix element access
+ assignment with pointers, fixes bug 519933
+
+ * tests/pointers.vala: test pointer element access
+
2008-04-06 Jürg Billeter <j@bitron.ch>
* vapi/packages/gtk+-2.0/: fix gtk_tree_sortable_get_sort_column_id
emit_property_assignment ();
} else if (assignment.left.symbol_reference is Signal) {
emit_signal_assignment ();
- } else if (assignment.left is ElementAccess && !(((ElementAccess) assignment.left).container.static_type is ArrayType)) {
+ } else if (assignment.left is ElementAccess
+ && !(((ElementAccess) assignment.left).container.static_type is ArrayType)
+ && !(((ElementAccess) assignment.left).container.static_type is PointerType)) {
emit_non_array_element_access ();
} else {
emit_simple_assignment ();
SimpleStruct* st = new SimpleStruct[1];
st->field = 1;
assert (st->field == st->test ());
+ delete st;
+
+ test_pointers_element_access ();
+ }
+
+ static void test_pointers_element_access () {
+ int* array = new int[42];
+ array[0] = 23;
+ assert (array[0] == 23);
+ delete array;
}
}