• Simon Zünd's avatar
    Reset DeclarationScope::function_ variable after pre-parsing · 70dd77c7
    Simon Zünd authored
    "--print-scopes" uses the {function_} variable to print the function
    name and locals of a function scope. In case of a pre-parsed function,
    the function variable of the scope lives in a zone which is nuked after
    pre-parsing, while the scope lives on. This leaves the {function_}
    variable pointer in the scope in a state where it points to
    invalid memory, causing "--print-scopes" to crash.
    This CL fixes the crash by properly resetting the {function_}
    pointer.
    
    TBR=verwaest@chromium.org
    
    Change-Id: Id24dbb605bec883317f676265a920fe0ca662301
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1776094Reviewed-by: 's avatarSimon Zünd <szuend@chromium.org>
    Commit-Queue: Simon Zünd <szuend@chromium.org>
    Auto-Submit: Simon Zünd <szuend@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#63513}
    70dd77c7
scopes.cc 90.5 KB