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/6.0] [mono] Use unsigned char when computing UTF8 string hashes #83303

Merged
merged 2 commits into from
Mar 30, 2023

Commits on Mar 14, 2023

  1. [mono] Use unsigned char when computing UTF8 string hashes

    The C standard does not specify whether `char` is signed or unsigned,
    it is implementation defined.
    
    Apparently Android aarch64 makes a different choice than other
    platforms (at least macOS arm64 and Windows x64 give different
    results).
    
    Mono uses `mono_metadata_str_hash` in the AOT compiler and AOT runtime
    to optimize class name lookup.  As a result, classes whose names
    include UTF-8 continuation bytes (with the high bit = 1) will hash
    differently in the AOT compiler and on the device.
    
    Fixes #82187
    Fixes #78638
    lambdageek committed Mar 14, 2023
    Configuration menu
    Copy the full SHA
    17281eb View commit details
    Browse the repository at this point in the history
  2. Add regression test

    lambdageek committed Mar 14, 2023
    Configuration menu
    Copy the full SHA
    e6dd087 View commit details
    Browse the repository at this point in the history