PLC-lang / rusty

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

fix: Array sizes in DWARF #1190

Closed volsa closed 1 month ago

volsa commented 1 month ago

This PR fixes a bug in which we would generate incorrect array sizes due to an off by one issue. This is because for an array such as ARRAY[1..5] we pass the range 1..5 to an inkwell function which calculates the size by subtracting the start from the end i.e. 5 - 1. ST array subranges are inclusive however, hence adding 1 to end value should fix this.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.64%. Comparing base (fedc06d) to head (b6aaab4). Report is 2 commits behind head on master.

:exclamation: Current head b6aaab4 differs from pull request most recent head da4f206. Consider uploading reports for the commit da4f206 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1190 +/- ## ========================================== + Coverage 95.62% 95.64% +0.02% ========================================== Files 150 148 -2 Lines 42657 42536 -121 ========================================== - Hits 40789 40685 -104 + Misses 1868 1851 -17 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.