Skip to content

Rector crashes on assert($startPos >= 0 && $endPos >= 0) #9491

@staabm

Description

@staabm

Bug Report

Subject Details
Rector version 2.2.8

in some classes of our project, rector started crashing with 2.2.8.
when analyzing those files in isolation I can't reproduce the crash though.

the crash is triggered in php-parser.

when adding a debug breakpoint, I can see that Rector tries to print a instance of Rector\PhpParser\Node\CustomNode\FileWithoutNamespace with a $startPos and $endPos of -1, which both violate this assert.

Image

Minimal PHP Code Causing Issue

I can't figure out a small reproducer

Expected Behaviour

no crash

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions