diff options
author | Bruce Forstall <brucefo@microsoft.com> | 2016-09-08 16:42:22 -0700 |
---|---|---|
committer | Bruce Forstall <brucefo@microsoft.com> | 2016-09-08 16:42:22 -0700 |
commit | 08f3ae19c6e07e6772ace96706012ed87e4e6f2e (patch) | |
tree | 2654f5d0f4e703f7bba7fce72a31c9f32db857a1 | |
parent | 65c2ff78e0e88f5052751747f6686084caab3d4c (diff) | |
download | coreclr-08f3ae19c6e07e6772ace96706012ed87e4e6f2e.tar.gz coreclr-08f3ae19c6e07e6772ace96706012ed87e4e6f2e.tar.bz2 coreclr-08f3ae19c6e07e6772ace96706012ed87e4e6f2e.zip |
Fix #7100
This issue is the following assert:
```
Assert failure '!emitComp->opts.compReloc || memBase->IsIconHandle()'
```
while ngen'ing mscorlib on desktop.
We're trying to generate
```
cmp ebx, dword ptr [0000H]
```
(due to inlining). But, emitInsBinary() doesn't expect a zero address that
is not a relocatable handle.
Simply change the assert to allow this. The code then generates the correct
zero base address.
-rw-r--r-- | src/jit/emitxarch.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/jit/emitxarch.cpp b/src/jit/emitxarch.cpp index d43f766ee8..6b7777a853 100644 --- a/src/jit/emitxarch.cpp +++ b/src/jit/emitxarch.cpp @@ -2499,8 +2499,9 @@ void emitter::emitHandleMemOp(GenTreeIndir* indir, instrDesc* id, insFormat fmt, // Absolute addresses marked as contained should fit within the base of addr mode. assert(memBase->AsIntConCommon()->FitsInAddrBase(emitComp)); - // Either not generating relocatable code or addr must be an icon handle - assert(!emitComp->opts.compReloc || memBase->IsIconHandle()); + // Either not generating relocatable code, or addr must be an icon handle, or the + // constant is zero (which we won't generate a relocation for). + assert(!emitComp->opts.compReloc || memBase->IsIconHandle() || memBase->IsIntegralConst(0)); if (memBase->AsIntConCommon()->AddrNeedsReloc(emitComp)) { |