[vala/0.36] vala: Report an error if rank attribute is required but was not found



commit e72fdce46ca2c9c434f2aa502289a1ba52767cbc
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Mon May 14 11:06:30 2018 +0200

    vala: Report an error if rank attribute is required but was not found
    
    https://bugzilla.gnome.org/show_bug.cgi?id=660991

 vala/valastruct.vala |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/vala/valastruct.vala b/vala/valastruct.vala
index 21985d7..12480fc 100644
--- a/vala/valastruct.vala
+++ b/vala/valastruct.vala
@@ -368,6 +368,9 @@ public class Vala.Struct : TypeSymbol {
                                var st = base_struct;
                                if (st != null) {
                                        rank = st.get_rank ();
+                               } else {
+                                       Report.error (source_reference, "internal error: struct has no rank");
+                                       return 0;
                                }
                        }
                }


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