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

release/18.x: backport [C++20] [Moduls] Avoid computing odr hash for functions from comparing constraint expression #84723

Merged
merged 1 commit into from
Mar 19, 2024

Commits on Mar 19, 2024

  1. [C++20] [Moduls] Avoid computing odr hash for functions from comparin…

    …g constraint expression
    
    Previously we disabled to compute ODR hash for declarations from the
    global module fragment. However, we missed the case that the functions
    lives in the concept requiments (see the attached the test files for
    example). And the mismatch causes the potential crashment.
    
    Due to we will set the function body as lazy after we deserialize it and
    we will only take its body when needed. However, we don't allow to take
    the body during deserializing. So it is actually potentially problematic
    if we set the body as lazy first and computing the hash value of the
    function, which requires to deserialize its body. So we will meet a
    crash here.
    
    This patch tries to solve the issue by not taking the body of the
    function from GMF. Note that we can't skip comparing the constraint
    expression from the GMF directly since it is an key part of the
    function selecting and it may be the reason why we can't return 0
    directly for `FunctionDecl::getODRHash()` from the GMF.
    ChuanqiXu9 authored and tstellar committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    0bf7ff1 View commit details
    Browse the repository at this point in the history