diff options
author | Andy Ayers <andya@microsoft.com> | 2018-09-20 15:02:58 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-20 15:02:58 -0700 |
commit | e30f187cda3767e1c50b870864de8d0eb5f8582a (patch) | |
tree | 0f892e999ac2a2bba32b90a95636da4cbab63062 /src/jit/flowgraph.cpp | |
parent | 4ca5cd260a1c04f74961faccfad3200fe865a249 (diff) | |
download | coreclr-e30f187cda3767e1c50b870864de8d0eb5f8582a.tar.gz coreclr-e30f187cda3767e1c50b870864de8d0eb5f8582a.tar.bz2 coreclr-e30f187cda3767e1c50b870864de8d0eb5f8582a.zip |
JIT: Fix operand evaluation order for GT_INDEX_ADDR (#20047)
We need to evaluate the array operand first, and it's op1. So evaluate
in that order, and don't allow reversal.
Closes #20040.
Diffstat (limited to 'src/jit/flowgraph.cpp')
-rw-r--r-- | src/jit/flowgraph.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/jit/flowgraph.cpp b/src/jit/flowgraph.cpp index d03c6e379a..18e663f91b 100644 --- a/src/jit/flowgraph.cpp +++ b/src/jit/flowgraph.cpp @@ -18685,10 +18685,10 @@ void Compiler::fgSetTreeSeqHelper(GenTree* tree, bool isLIR) break; case GT_INDEX_ADDR: - // Evaluate the index first, then the array address - assert((tree->gtFlags & GTF_REVERSE_OPS) != 0); - fgSetTreeSeqHelper(tree->AsIndexAddr()->Index(), isLIR); + // Evaluate the array first, then the index.... + assert((tree->gtFlags & GTF_REVERSE_OPS) == 0); fgSetTreeSeqHelper(tree->AsIndexAddr()->Arr(), isLIR); + fgSetTreeSeqHelper(tree->AsIndexAddr()->Index(), isLIR); break; default: |