diff --git a/src/libraries/System.Collections.Immutable/tests/ImmutableListTestBase.cs b/src/libraries/System.Collections.Immutable/tests/ImmutableListTestBase.cs index 7fc27620ad48a..1144529e79076 100644 --- a/src/libraries/System.Collections.Immutable/tests/ImmutableListTestBase.cs +++ b/src/libraries/System.Collections.Immutable/tests/ImmutableListTestBase.cs @@ -419,7 +419,6 @@ public void BinarySearch() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/85012", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] public void BinarySearchPartialSortedList() { ImmutableArray reverseSorted = ImmutableArray.CreateRange(Enumerable.Range(1, 150).Select(n => n * 2).Reverse()); diff --git a/src/mono/mono/mini/mini-llvm.c b/src/mono/mono/mini/mini-llvm.c index d4e3e3754966b..5bdfeabd24943 100644 --- a/src/mono/mono/mini/mini-llvm.c +++ b/src/mono/mono/mini/mini-llvm.c @@ -4756,7 +4756,8 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref, mono_llvm_add_instr_byval_attr (lcall, 1 + ainfo->pindex, LLVMGetElementType (param_types [ainfo->pindex])); } - gboolean is_simd = MONO_CLASS_IS_SIMD (ctx->cfg, mono_class_from_mono_type_internal (sig->ret)); + MonoClass *retclass = mono_class_from_mono_type_internal (sig->ret); + gboolean is_simd = MONO_CLASS_IS_SIMD (ctx->cfg, retclass); gboolean should_promote_to_value = FALSE; const char *load_name = NULL; /* @@ -4821,11 +4822,17 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref, case LLVMArgGsharedvtFixedVtype: values [ins->dreg] = LLVMBuildLoad2 (builder, rtype, convert_full (ctx, addresses [call->inst.dreg]->value, pointer_type (rtype), FALSE), ""); break; - case LLVMArgWasmVtypeAsScalar: + case LLVMArgWasmVtypeAsScalar: { + /* + * If the vtype contains references, making the store volatile ensures there is a reference + * on the stack. + */ + gboolean is_volatile = m_class_has_references (retclass); if (!addresses [call->inst.dreg]) addresses [call->inst.dreg] = build_alloca_address (ctx, sig->ret); - LLVMBuildStore (builder, lcall, convert_full (ctx, addresses [call->inst.dreg]->value, pointer_type (LLVMTypeOf (lcall)), FALSE)); + emit_store (builder, lcall, convert_full (ctx, addresses [call->inst.dreg]->value, pointer_type (LLVMTypeOf (lcall)), FALSE), is_volatile); break; + } default: if (sig->ret->type != MONO_TYPE_VOID) /* If the method returns an unsigned value, need to zext it */