Skip to content

unpack::<N> should fail typecheck on rank-M (M != N) shapes #306

Description

@statusfailed

The problem is here:

            // write each result into state at op.targets ids
            for ((node_id, _), result) in ssa.targets.iter().zip(results) {
                on_write(*node_id, &result);
                if state.insert(*node_id, result).is_some() {
                    return Err(InterpreterError::MultipleWrite(*node_id));
                }
            }

Namely: rust's zip is silently truncating one of the iterators.

Fix: insert a length check that there are exactly as many results as targets.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomers

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions