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

JIT: fix byte range used by RangeCheck #21915

Merged
merged 2 commits into from Jan 11, 2019

Conversation

Projects
None yet
4 participants
@AndyAyersMS
Copy link
Member

AndyAyersMS commented Jan 9, 2019

Fix wrong byte range introduced in #21857.

Thanks to @jakobbotsch for spotting this.

@AndyAyersMS

This comment has been minimized.

Copy link
Member

AndyAyersMS commented Jan 9, 2019

cc @dotnet/jit-contrib

No diffs in pmi fx.

@hughbe

This comment has been minimized.

Copy link
Contributor

hughbe commented Jan 9, 2019

Just curious and for a bunch of small jit fixes, why do they not have tests? I get slightly confused when code changes occur without tests? In llvm, for example, all small changes verify actual asm output (obviously too much in clr) but does the type of testing in coreclr need to be improved?

@BruceForstall

This comment has been minimized.

Copy link
Contributor

BruceForstall commented Jan 9, 2019

@hughbe It's generally a good idea to add tests, when possible. If @AndyAyersMS can come up with a test exhibiting a difference here, that would be great. Sometimes it's too expensive or not feasible.

@AndyAyersMS

This comment has been minimized.

Copy link
Member

AndyAyersMS commented Jan 9, 2019

I'll see if I can come up with something, though the most likely impact is a missed optimization, and we don't have a great testing strategy for those.

@filipnavara

This comment has been minimized.

Copy link
Collaborator

filipnavara commented Jan 10, 2019

Looks like in this case you may end-up with missing bounds check in extreme case. That probably should be testable. Feel free to correct me if I am wrong.

I am thinking of pseudo code akin to this:

Array data = Array.CreateInstance(typeof(int),
    new int[] { -127, 256 });
byte index = -128;
data[index] = 0; // Range check would be incorrectly omitted and memory accessed out of range
@AndyAyersMS

This comment has been minimized.

Copy link
Member

AndyAyersMS commented Jan 10, 2019

I have something similar in the works, will push it on this PR shortly. RangeCheck doesn't model a lot of IR operators so you have to be careful to choose just the right expressions.

@AndyAyersMS

This comment has been minimized.

Copy link
Member

AndyAyersMS commented Jan 10, 2019

Test covers some of the byte/sbyte boundaries, and will fail without this fix.

@AndyAyersMS AndyAyersMS merged commit 360e70f into dotnet:master Jan 11, 2019

32 checks passed

CentOS7.1 x64 Checked Innerloop Build and Test Build finished.
Details
CentOS7.1 x64 Debug Innerloop Build Build finished.
Details
Linux-musl x64 Debug Build Build finished.
Details
OSX10.12 x64 Checked Innerloop Build and Test Build finished.
Details
Tizen armel Cross Checked Innerloop Build and Test Build finished.
Details
Ubuntu arm Cross Checked Innerloop Build and Test Build finished.
Details
Ubuntu arm Cross Checked crossgen_comparison Build and Test Build finished.
Details
Ubuntu arm Cross Checked no_tiered_compilation_innerloop Build and Test Build finished.
Details
Ubuntu arm Cross Release crossgen_comparison Build and Test Build finished.
Details
Ubuntu x64 Checked CoreFX Tests Build finished.
Details
Ubuntu x64 Checked Innerloop Build and Test Build finished.
Details
Ubuntu x64 Checked Innerloop Build and Test (Jit - TieredCompilation=0) Build finished.
Details
Ubuntu x64 Formatting Build finished.
Details
Ubuntu16.04 arm64 Cross Checked Innerloop Build and Test Build finished.
Details
Ubuntu16.04 arm64 Cross Checked no_tiered_compilation_innerloop Build and Test Build finished.
Details
Windows_NT arm Cross Checked Innerloop Build and Test Build finished.
Details
Windows_NT arm Cross Debug Innerloop Build Build finished.
Details
Windows_NT arm64 Cross Checked Innerloop Build and Test Build finished.
Details
Windows_NT arm64 Cross Debug Innerloop Build Build finished.
Details
Windows_NT x64 Checked CoreFX Tests Build finished.
Details
Windows_NT x64 Checked Innerloop Build and Test Build finished.
Details
Windows_NT x64 Checked Innerloop Build and Test (Jit - TieredCompilation=0) Build finished.
Details
Windows_NT x64 Formatting Build finished.
Details
Windows_NT x64 Release CoreFX Tests Build finished.
Details
Windows_NT x64 full_opt ryujit CoreCLR Perf Tests Correctness Build finished.
Details
Windows_NT x64 min_opt ryujit CoreCLR Perf Tests Correctness Build finished.
Details
Windows_NT x86 Checked Innerloop Build and Test Build finished.
Details
Windows_NT x86 Checked Innerloop Build and Test (Jit - TieredCompilation=0) Build finished.
Details
Windows_NT x86 Release Innerloop Build and Test Build finished.
Details
Windows_NT x86 full_opt ryujit CoreCLR Perf Tests Correctness Build finished.
Details
Windows_NT x86 min_opt ryujit CoreCLR Perf Tests Correctness Build finished.
Details
license/cla All CLA requirements met.
Details

@AndyAyersMS AndyAyersMS deleted the AndyAyersMS:FixByteRange branch Jan 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment