From: Kevin Wasserman Date: Thu, 14 Nov 2013 17:01:11 +0000 (-0500) Subject: Workaround vala 0.10 bug LP 1250543 X-Git-Tag: 0.7.1~29 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=moonshot-ui.git;a=commitdiff_plain;h=b872424969af28fa2442d78143e40e7bc36739c0 Workaround vala 0.10 bug LP 1250543 vala 0.10 appears to generate completely broken c code when attempting to drectly access the length of an array property. Fixes segfault in moonshot-webp on Centos. --- diff --git a/src/moonshot-provisioning-common.vala b/src/moonshot-provisioning-common.vala index 347bd32..73704d4 100644 --- a/src/moonshot-provisioning-common.vala +++ b/src/moonshot-provisioning-common.vala @@ -1,3 +1,4 @@ + namespace WebProvisioning { IdCard card; @@ -168,16 +169,16 @@ namespace WebProvisioning /* Rules */ else if (stack.nth_data(0) == "pattern" && pattern_handler (stack)) { - /* use temp index to workaround valac bug */ - int index = card.rules.length - 1; - card.rules[index].pattern = text; + /* use temp array to workaround valac 0.10 bug accessing array property length */ + var temp = card.rules; + card.rules[temp.length - 1].pattern = text; } else if (stack.nth_data(0) == "always-confirm" && always_confirm_handler (stack)) { if (text == "true" || text == "false") { - /* use temp index to workaround valac bug */ - int index = card.rules.length - 1; - card.rules[index].always_confirm = text; + /* use temp array to workaround valac 0.10 bug accessing array property length*/ + var temp = card.rules; + card.rules[temp.length - 1].always_confirm = text; } } /*Trust anchor*/