未验证 提交 e4dd880e 编写于 作者: V Vlad Brezae 提交者: GitHub

[mono][interp] Return null for localloc with len 0 (#73174)

so that accessing the result address throws exception.

Fixes https://github.com/dotnet/runtime/issues/54359
上级 e117479e
......@@ -7127,10 +7127,15 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK;
MINT_IN_CASE(MINT_LOCALLOC) {
int len = LOCAL_VAR (ip [2], gint32);
gpointer mem = frame_data_allocator_alloc (&context->data_stack, frame, ALIGN_TO (len, MINT_VT_ALIGNMENT));
gpointer mem;
if (len > 0) {
mem = frame_data_allocator_alloc (&context->data_stack, frame, ALIGN_TO (len, MINT_VT_ALIGNMENT));
if (frame->imethod->init_locals)
memset (mem, 0, len);
if (frame->imethod->init_locals)
memset (mem, 0, len);
} else {
mem = NULL;
}
LOCAL_VAR (ip [1], gpointer) = mem;
ip += 3;
MINT_IN_BREAK;
......
......@@ -2504,9 +2504,6 @@
<ExcludeList Include = "$(XunitTestBinBase)/JIT/Regression/JitBlue/DevDiv_544983/DevDiv_544983/**">
<Issue>https://github.com/dotnet/runtime/issues/54393</Issue>
</ExcludeList>
<ExcludeList Include = "$(XunitTestBinBase)/JIT/CodeGenBringUpTests/Localloc_do/**">
<Issue>https://github.com/dotnet/runtime/issues/54359</Issue>
</ExcludeList>
<ExcludeList Include = "$(XunitTestBinBase)/JIT/Directed/Misc/function_pointer/MutualThdRecur-fptr/**">
<Issue>needs triage</Issue>
</ExcludeList>
......@@ -2624,9 +2621,6 @@
<ExcludeList Include = "$(XunitTestBinBase)/JIT/Methodical/eh/interactions/strswitchfinal_d/**">
<Issue>needs triage</Issue>
</ExcludeList>
<ExcludeList Include = "$(XunitTestBinBase)/JIT/CodeGenBringUpTests/Localloc_do/**">
<Issue>https://github.com/dotnet/runtime/issues/54359</Issue>
</ExcludeList>
<ExcludeList Include = "$(XunitTestBinBase)/JIT/Directed/Misc/function_pointer/MutualThdRecur-fptr/**">
<Issue>needs triage</Issue>
</ExcludeList>
......@@ -2642,15 +2636,6 @@
<ExcludeList Include = "$(XunitTestBinBase)/Loader/classloader/DefaultInterfaceMethods/diamondshape/diamondshape_r/**">
<Issue>https://github.com/dotnet/runtime/issues/54399</Issue>
</ExcludeList>
<ExcludeList Include = "$(XunitTestBinBase)/JIT/CodeGenBringUpTests/Localloc_r/**">
<Issue>https://github.com/dotnet/runtime/issues/54359</Issue>
</ExcludeList>
<ExcludeList Include = "$(XunitTestBinBase)/JIT/CodeGenBringUpTests/Localloc_ro/**">
<Issue>https://github.com/dotnet/runtime/issues/54359</Issue>
</ExcludeList>
<ExcludeList Include = "$(XunitTestBinBase)/JIT/CodeGenBringUpTests/Localloc_d/**">
<Issue>https://github.com/dotnet/runtime/issues/54359</Issue>
</ExcludeList>
<ExcludeList Include = "$(XunitTestBinBase)/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b25459/b25459/**">
<Issue>https://github.com/dotnet/runtime/issues/54393</Issue>
</ExcludeList>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册