[vala/emit-let: 6/6] codegen: Fix lvalue access to fields
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/emit-let: 6/6] codegen: Fix lvalue access to fields
- Date: Wed, 16 Mar 2011 14:33:06 +0000 (UTC)
commit ca22f9e6fc1d2edc9781a1eb835ef6e47d389f35
Author: Luca Bruno <lucabru src gnome org>
Date: Wed Mar 16 15:25:36 2011 +0100
codegen: Fix lvalue access to fields
codegen/valaccodememberaccessmodule.vala | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valaccodememberaccessmodule.vala b/codegen/valaccodememberaccessmodule.vala
index 285c09a..17c9719 100644
--- a/codegen/valaccodememberaccessmodule.vala
+++ b/codegen/valaccodememberaccessmodule.vala
@@ -121,7 +121,11 @@ public abstract class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
set_cvalue (expr, get_array_length_cexpression (expr.inner, 1));
} else if (expr.symbol_reference is Field) {
var field = (Field) expr.symbol_reference;
- expr.target_value = load_field (field, expr.inner != null ? expr.inner.target_value : null);
+ if (expr.lvalue) {
+ expr.target_value = get_field_cvalue (field, expr.inner != null ? expr.inner.target_value : null);
+ } else {
+ expr.target_value = load_field (field, expr.inner != null ? expr.inner.target_value : null);
+ }
} else if (expr.symbol_reference is EnumValue) {
var ev = (EnumValue) expr.symbol_reference;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]