Commit 837d593e authored by Rico Tzschichholz's avatar Rico Tzschichholz

codegen: Replace invalid array-length assert with internal error

While the test-suite triggers this assert with an invalid test an explicit
crash is not wanted.
parent 81658eb9
......@@ -147,7 +147,10 @@ public class Vala.CCodeArrayModule : CCodeMethodCallModule {
List<CCodeExpression> size = ((GLibValue) value).array_length_cvalues;
assert (size != null && size.size >= dim);
if (size == null || size.size < dim) {
Report.error (null, "internal error: invalid array_length for given dimension");
return new CCodeInvalidExpression ();
return size[dim - 1];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment