[Vala] arrays of strings not properly initialized.
- From: Xavier Bestel <xavier bestel free fr>
- To: vala paldo org
- Subject: [Vala] arrays of strings not properly initialized.
- Date: Tue, 14 Aug 2007 16:35:18 +0200
Hi,
When writing that code:
string[] tabs = new string[3] { "az", "er", "ty" }
tabs[1] = "smorlbluck";
Vala initializes the array with static strings, which is wrong (and
fails when it tries to free(tabs[1]) before reassigning it).
Generated code:
__temp1 = NULL;
__temp0 = NULL;
tabs = (__temp1 = (__temp0 = g_new0 (char*, 3), __temp0[0] = "az", __temp0[1] = "er", __temp0[2] =
"ty", __temp0), tabs_length1 = 3, __temp1);
__temp2 = NULL;
tabs[1] = (__temp2 = g_strdup ("smorlbluck"), (tabs[1] = (g_free (tabs[1]), NULL)), __temp2);
(tabs = (g_strfreev (tabs), NULL));
Xav
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]