Using ANY with linearized arrays of different ranks causes a crash

Description

ANY works with arrays of the same rank, directly or after linearization ((/array/)).

But it seems some property of the array before linearization is being used incorrectly, causing the crash.

 

Activity

Leandro Lupori 
March 31, 2023 at 12:29 PM
(edited)

The issue was really in the evaluation tree. The problem was when it was folded, or actually rewritten in this case.
(/a/) /= (/b/) was being transformed into (/a /= b/), which is not valid when a and b don't have the same rank and extents.
The solution was to not rewrite expressions like this when the values' ranks/extents don't match.

The lowering code was correct and needed no changes.

Leandro Lupori 
March 29, 2023 at 8:52 PM

Leandro Lupori 
March 22, 2023 at 11:29 PM
(edited)

The crash is caused while lowering an array expression such as (/a/) /= (/b/), when a and b have different ranks, because its resulting type is deduced incorrectly.

The lowering code seems correct, but the evaluation sub-tree used by it, generated during semantic analysis, seems to be missing the array constructors operations. The parse tree was inspected and is correct.

This issue is more complex than what was initially estimated.

Done

Details

Assignee

Reporter

Due date

Start date

Original estimate

Time tracking

2w logged

Fix versions

Priority

Checklist

Sentry

Created February 6, 2023 at 2:00 PM
Updated March 31, 2023 at 12:30 PM
Resolved March 31, 2023 at 12:29 PM