Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange start line numbers for AST_IF elements #50

Closed
TysonAndre opened this issue Mar 17, 2017 · 1 comment
Closed

Strange start line numbers for AST_IF elements #50

TysonAndre opened this issue Mar 17, 2017 · 1 comment

Comments

@TysonAndre
Copy link
Collaborator

For the below code, with ast VERSION 40 (or 30)

<?php
if (true) {

} else {
}
AST_STMT_LIST @ 1
    0: AST_IF @ 4
        0: AST_IF_ELEM @ 2
            cond: AST_CONST @ 2
                name: AST_NAME @ 2
                    flags: NAME_NOT_FQ (1)
                    name: "true"
            stmts: AST_STMT_LIST @ 2
        1: AST_IF_ELEM @ 4
            cond: null
            stmts: AST_STMT_LIST @ 4

Observed: The line number of AST_IF is 4. The line number of the first AST_IF_ELEM below it is 2.
Expected: The line number of AST_IF should be 2 (4 doesn't make sense as a starting line number)

@nikic
Copy link
Owner

nikic commented Mar 17, 2017

Fixed upstream with php/php-src@183cd04. In this particular case, the end line of the first element in the list was assigned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants