/* ------------------------------------------------------------------------- */
/* "expressc" : The expression code generator */
/* */
-/* Part of Inform 6.40 */
+/* Part of Inform 6.41 */
/* copyright (c) Graham Nelson 1993 - 2022 */
/* */
/* Inform is free software: you can redistribute it and/or modify */
assembly_operand zero_ao, max_ao, size_ao, en_ao, type_ao, an_ao,
index_ao;
- int x = 0, y = 0, byte_flag = FALSE, read_flag = FALSE, from_module = FALSE;
+ int x = 0, y = 0, byte_flag = FALSE, read_flag = FALSE;
INITAO(&zero_ao);
INITAO(&size_ao);
error("Cannot write to a static array");
}
- if (size_ao.value==-1)
- from_module=TRUE;
+ if (size_ao.value==-1) {
+ /* This case was originally meant for module linking.
+ It should no longer be possible. */
+ compiler_error("Array size cannot be negative");
+ }
else {
- from_module=FALSE;
type_ao = zero_ao; type_ao.value = arrays[y].type;
if ((!is_systemfile()))
/* If we recognise AO1 as arising textually from a declared
array, we can check bounds explicitly. */
- if ((AO1.marker == ARRAY_MV || AO1.marker == STATIC_ARRAY_MV) && (!from_module))
+ if ((AO1.marker == ARRAY_MV || AO1.marker == STATIC_ARRAY_MV))
{
int passed_label = next_label++, failed_label = next_label++,
final_label = next_label++;