PLC-lang / rusty

Structured Text Parser and LLVM Frontend
GNU Lesser General Public License v3.0
181 stars 47 forks source link

feat: Validate Array Ranges #1195

Closed volsa closed 3 weeks ago

volsa commented 1 month ago

This PR adds a validation for the ranges of arrays, in which the start values must be less than the end values. For example something like ... ARRAY[1..-5] OF ... is invalid because -5 < 1. Previously this would either panic (debug mode) or generate huge arrays (release mode) due to overflows.