Skip to content

[Analysis] AlterTableDecorator.php: $insertStart[$j] loop-bound findings stem from mago flow-analysis limitation #69

Description

@tyrsson

Context

Part of #60.

Data

mago analyze flags possibly-undefined-int-array-index, possibly-null-argument, and possibly-null-operand around $insertStart[$j] in processAddColumns()/processChangeColumns(). $insertStart is returned by getSqlInsertOffsets() with a guaranteed array{0: int, 1: int, 2: int, 3: int} shape, and $j only ever takes values 0-3 (set via the switch in the outer loop, then incremented by for (; $j < $insertStartCount; ++$j)). mago cannot correlate the for loop's incrementing bound against the array's guaranteed size, the same class of limitation already documented for Statement.php (#61) and Result.php's dereference loop (#66).

These findings will be captured in a mago baseline rather than fixed or suppressed inline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions