From: Rico Tzschichholz Date: Sat, 21 Mar 2020 16:09:30 +0000 (+0100) Subject: codegen: IntegerLiteral is a valid constant size for inline-allocated array X-Git-Tag: 0.48.2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e7332ab08ff483d23260059c7a24a9bc17993cf;p=thirdparty%2Fvala.git codegen: IntegerLiteral is a valid constant size for inline-allocated array In addition to b95a766454eb914f4eb5a68e9040e03faffabf52 See https://gitlab.gnome.org/GNOME/vala/issues/910 --- 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) {