]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: IntegerLiteral is a valid constant size for inline-allocated array 7e7332ab08ff483d23260059c7a24a9bc17993cf
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 21 Mar 2020 16:09:30 +0000 (17:09 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 21 Mar 2020 16:09:30 +0000 (17:09 +0100)
In addition to b95a766454eb914f4eb5a68e9040e03faffabf52

See https://gitlab.gnome.org/GNOME/vala/issues/910

codegen/valaccodebasemodule.vala

index a21b8f3155431d941953cbfbe5a27262163a6321..85ea40d5fdc979716a619e96f2569e11abf0ed5a 100644 (file)
@@ -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) {