From de6c7814a8891229ff72ed830a80f38eaee894f2 Mon Sep 17 00:00:00 2001 From: t-mustafin <66252296+t-mustafin@users.noreply.github.com> Date: Mon, 8 Jun 2020 16:55:06 +0300 Subject: [PATCH] [crossgen2][arm] Fix assertion repro237932.cs (#37588) Fix assertion on crossgen2 Debug on ni-compile of 237932/repro237932.cs test for arm architecture. Signed-off-by: Timur --- .../ReadyToRun/Target_ARM/ImportThunk.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Target_ARM/ImportThunk.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Target_ARM/ImportThunk.cs index 1557692..2741f44 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Target_ARM/ImportThunk.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/Target_ARM/ImportThunk.cs @@ -34,11 +34,15 @@ namespace ILCompiler.DependencyAnalysis.ReadyToRun // r4 contains indirection cell // push r4 instructionEncoder.EmitPUSH(Register.R4); - int index = _instanceCell.Table.IndexFromBeginningOfArray; - // mov r4, #index - instructionEncoder.EmitMOV(Register.R4, index); - // push r4 - instructionEncoder.EmitPUSH(Register.R4); + + if (!relocsOnly) + { + int index = _instanceCell.Table.IndexFromBeginningOfArray; + // mov r4, #index + instructionEncoder.EmitMOV(Register.R4, index); + // push r4 + instructionEncoder.EmitPUSH(Register.R4); + } // mov r4, [module] instructionEncoder.EmitMOV(Register.R4, _moduleImport); -- 2.7.4