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

Add back missing conv opcodes when compiling via System.Linq.Expressions #76024

Merged
merged 2 commits into from
Sep 24, 2022

Commits on Sep 23, 2022

  1. Add new convert tests

    With expression funcs that return int32 instead of short/byte to prevent implicit conversions.
    BrzVlad committed Sep 23, 2022
    Configuration menu
    Copy the full SHA
    e22c917 View commit details
    Browse the repository at this point in the history
  2. Add back missing conv opcodes when compiling via System.Linq.Expressions

    The conversion opcodes are still necessary when the sign of the value might change, in which case the conversion opcode will do a sign/zero extend to the full i32 storage used by the IL execution stack.
    
    For example, before this change, conversions from ushort to short were ignored. Consider expressions converting the value `ushort.MaxValue` to short (testcase ConvertUShortToShortTest). `ushort.MaxValue` will be pushed to execution stack as a i32 ldc of value 0xffff. The conv.i2 opcode would change the value on the stack to 0xffffffff so it shouldn't be omitted.
    BrzVlad committed Sep 23, 2022
    Configuration menu
    Copy the full SHA
    f322b1f View commit details
    Browse the repository at this point in the history