[vala/wip/effectfree: 9/9] codegen: Use temporary variables in member access for possible side effects
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/effectfree: 9/9] codegen: Use temporary variables in member access for possible side effects
- Date: Thu, 16 Jun 2011 08:24:34 +0000 (UTC)
commit 2d3f8e2b1a2b2cc83ba3c9a6f03df1fc622e12ed
Author: Luca Bruno <lucabru src gnome org>
Date: Wed Jun 15 13:27:21 2011 +0200
codegen: Use temporary variables in member access for possible side effects
codegen/valaccodememberaccessmodule.vala | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/codegen/valaccodememberaccessmodule.vala b/codegen/valaccodememberaccessmodule.vala
index 443992f..836d740 100644
--- a/codegen/valaccodememberaccessmodule.vala
+++ b/codegen/valaccodememberaccessmodule.vala
@@ -326,6 +326,9 @@ public abstract class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
// don't unref variable
local.active = false;
+ } else if (!expr.lvalue && !(expr.parent_node is MemberAccess && expr.target_value.value_type.is_real_non_null_struct_type ()) && !(expr.target_value.value_type is ArrayType && ((ArrayType) expr.target_value.value_type).inline_allocated)) {
+ var temp_value = create_temp_value (expr.target_value.value_type, expr.target_value, expr);
+ expr.target_value = temp_value;
}
} else if (expr.symbol_reference is Parameter) {
var param = (Parameter) expr.symbol_reference;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]