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



commit 02385c9c008d363c01729c9aed4bd454634ce922
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]