]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
DEBUG
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 14 Nov 2020 07:19:23 +0000 (08:19 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 14 Nov 2020 14:57:22 +0000 (15:57 +0100)
codegen/valaccodebasemodule.vala
codegen/valaccodemethodcallmodule.vala
vala/valaparameter.vala

index 41736e5280e6bb68c1578ff2dd8304cd770d8258..c6391d387f4fedb845ad573752aff766145eb439 100644 (file)
@@ -2720,6 +2720,12 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
        public TargetValue store_temp_value (TargetValue initializer, CodeNode node_reference, bool? value_owned = null) {
                var lvalue = create_temp_value (initializer.value_type, false, node_reference, value_owned);
                store_value (lvalue, initializer, node_reference.source_reference);
+               if (lvalue.value_type is ArrayType) {
+                       stdout.printf ("%s tweaked\n", node_reference.to_string ());
+                       /*((GLibValue) lvalue).array_length_cvalues = null;
+                       ((GLibValue) lvalue).array_size_cvalue = null;
+                       ((GLibValue) lvalue).array_length_cexpr = null;*/
+               }
                return load_temp_value (lvalue);
        }
 
@@ -5224,6 +5230,12 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
        }
 
        public override void visit_sizeof_expression (SizeofExpression expr) {
+               // FIXME
+               if (expr.value_type == null) {
+                       warning ("BAD %s\n", expr.to_string ());
+                       expr.value_type = context.analyzer.ulong_type.copy ();
+               }
+
                generate_type_declaration (expr.type_reference, cfile);
 
                var csizeof = new CCodeFunctionCall (new CCodeIdentifier ("sizeof"));
@@ -5238,6 +5250,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
        }
 
        public override void visit_unary_expression (UnaryExpression expr) {
+               assert (expr.checked);
                if (expr.operator == UnaryOperator.REF || expr.operator == UnaryOperator.OUT) {
                        var glib_value = (GLibValue) expr.inner.target_value;
 
@@ -5845,6 +5858,13 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
        }
 
        public override void visit_type_check (TypeCheck expr) {
+               assert (expr.checked);
+               // FIXME
+               if (expr.value_type == null) {
+                       warning ("BAD %s\n", expr.to_string ());
+                       expr.value_type = context.analyzer.bool_type.copy ();
+               }
+
                generate_type_declaration (expr.type_reference, cfile);
 
                var type = expr.expression.value_type;
index c196928c8b1c01d9dff0f0b60e3f4d8be30ff75d..6abc25e2d1b489f089d28b72da4cddc3036d6db7 100644 (file)
@@ -431,6 +431,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
                                                var temp_var = get_temp_variable (param.variable_type, param.variable_type.value_owned, null, true);
                                                emit_temp_var (temp_var);
                                                set_cvalue (arg, get_variable_cexpression (temp_var.name));
+                                               stdout.printf ("%s.%s\n", param.parent_symbol.to_string (), param.name);
                                                arg.target_value.value_type = arg.target_type.copy ();
 
                                                cexpr = new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, get_cvalue (arg));
index 41a59da6105a80a12ff9363eefbaa9f23d21456d..05a1e9f659230776fefdba2328c51236d73b239c 100644 (file)
@@ -138,6 +138,11 @@ public class Vala.Parameter : Variable {
                if (source_reference != null) {
                        context.analyzer.current_source_file = source_reference.file;
                }
+               
+               if (parent_symbol == null) {
+                       stdout.printf ("%s\n", name);
+                       assert_not_reached ();
+               }
                context.analyzer.current_symbol = parent_symbol;
 
                if (variable_type != null) {