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

Fix correctness issues in sizeof tfunc #36727

Merged
merged 1 commit into from
Jul 20, 2020
Merged

Fix correctness issues in sizeof tfunc #36727

merged 1 commit into from
Jul 20, 2020

Commits on Jul 19, 2020

  1. Fix correctness issues in sizeof tfunc

    The `Core.sizeof` function can take either a value or a type,
    which can be a bit confusing in the tfunc, because the tfunc
    operates on the types of the values passed to the builtin.
    In particular, we were incorrectly returning Const(16) (on 64bit)
    for sizeof_tfunc(UnionAll), because it was treating it the asme
    as `sizeof_tfunc(Const(UnionAll))`. Try to clean that up as well
    as fixing a similar confusion in the nothrow version of this
    function. Lastly, we had a similar fast path in codegen, which
    would try to inline the actual size for a constant datatype argument.
    For codegen, just rm that whole code path, since it should have no
    more information than inference and figuring it out in inference
    exposes strictly more optimization opportunities.
    
    Fixes #36710
    Keno committed Jul 19, 2020
    Configuration menu
    Copy the full SHA
    35a02ec View commit details
    Browse the repository at this point in the history