[vala] girwriter: Fix crash in attribute handling



commit fe49c956659a693e8a603007c9a5a6600501b85e
Author: Jürg Billeter <j bitron ch>
Date:   Thu Sep 16 17:32:53 2010 +0200

    girwriter: Fix crash in attribute handling
    
    Fixes bug 629364.

 codegen/valagirwriter.vala |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala
index 4890aa6..b184947 100644
--- a/codegen/valagirwriter.vala
+++ b/codegen/valagirwriter.vala
@@ -882,15 +882,11 @@ public class Vala.GIRWriter : CodeVisitor {
 		foreach (Attribute attr in node.attributes) {
 			string name = camel_case_to_canonical (attr.name);
 			foreach (string arg_name in attr.args.get_keys ()) {
-				var arg = attr.args.get (arg_name);
+				string value = attr.args.get (arg_name);
 
-				string value = literal_expression_to_value_string ((Literal) arg);
-
-				if (value != null) {
-					write_indent ();
-					buffer.append_printf ("<annotation key=\"%s.%s\" value=\"%s\"/>\n",
-						name, camel_case_to_canonical (arg_name), value);
-				}
+				write_indent ();
+				buffer.append_printf ("<annotation key=\"%s.%s\" value=\"%s\"/>\n",
+					name, camel_case_to_canonical (arg_name), value);
 			}
 		}
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]