[vala/staging] codegen: IntegerLiteral is a valid constant size for inline-allocated array



commit 7e7332ab08ff483d23260059c7a24a9bc17993cf
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Mar 21 17:09:30 2020 +0100

    codegen: IntegerLiteral is a valid constant size for inline-allocated array
    
    In addition to b95a766454eb914f4eb5a68e9040e03faffabf52
    
    See https://gitlab.gnome.org/GNOME/vala/issues/910

 codegen/valaccodebasemodule.vala | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index a21b8f315..85ea40d5f 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -1457,6 +1457,8 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                if (expr is Constant) {
                        // Local constants are not considered constant in C
                        return !(((Constant) expr).parent_symbol is Block);
+               } else if (expr is IntegerLiteral) {
+                       return ((IntegerLiteral) expr).is_constant ();
                } else if (expr is MemberAccess) {
                        return is_constant_ccode (((MemberAccess) expr).symbol_reference);
                } else if (expr is CastExpression) {


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