Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[mono][interp] Don't populate wrong type information into the stack s…
…tate
  • Loading branch information
BrzVlad committed May 23, 2023
commit 3b7d61da0a8c22abb5a8c0ab9c4f3a46d6cbb952
10 changes: 9 additions & 1 deletion src/mono/mono/mini/interp/transform.c
Original file line number Diff line number Diff line change
Expand Up @@ -785,8 +785,16 @@ init_bb_stack_state (TransformData *td, InterpBasicBlock *bb)
{
// FIXME If already initialized, then we need to generate mov to the registers in the state.
// Check if already initialized
if (bb->stack_height >= 0)
if (bb->stack_height >= 0) {
// Discard type information if we have type conflicts for stack contents
for (int i = 0; i < bb->stack_height; i++) {
if (bb->stack_state [i].klass != td->stack [i].klass) {
bb->stack_state [i].klass = NULL;
td->stack [i].klass = NULL;
}
}
return;
}

bb->stack_height = GPTRDIFF_TO_INT (td->sp - td->stack);
if (bb->stack_height > 0) {
Expand Down