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

Use retrun value of zephir_parse_file() trigger a signal 11: SIGSEGV #47

Open
heyuuu opened this issue Nov 20, 2018 · 0 comments
Open

Comments

@heyuuu
Copy link

heyuuu commented Nov 20, 2018

Describe the bug
The process interrupted by signal 11: SIGSEGV when do same logic in return val of zephir_parse_file twice.

To Reproduce
Run this code:

function once()
{
    $code = "class Translate {}";
    $ast  = zephir_parse_file($code, '/test_filename.zep');

    try {
        $node = $ast[0];

        unset($node['type']);
        unset($node['file']);
        unset($node['line']);
        unset($node['char']);

        throw new \Exception();
    } catch (\Exception $e) {
    }
}

once();
once(); // It trigger error in second times

Expected behavior
Don't trgger error.

Environment (please complete the following information):

  • OS: MacOS 10.14
  • Zephir Parser version: development(b8e3162)
  • Installation type: compiling from source
  • Compiler version [e.g. gcc 5.4.0]: Apple LLVM version 10.0.0 (clang-1000.11.45.5)
  • PHP version [e.g. 7.2.4 ( NTS )]: 7.0.30
@sergeyklay sergeyklay self-assigned this Nov 20, 2018
@sergeyklay sergeyklay removed their assignment Sep 7, 2020
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