Commit a04bc0c
authored
[mono][interp] Fix type of args when inlining method (#102801)
The vars allocated from pushing values on the execution stack might not reflect exactly the actual type of the var. Consider this pattern:
condbr BB0
newobj Derived // push var0 of type Derived
br BB1
BB0:
newobj Base // push var1 of type Base
// here we will end up inserting a `mov var1 -> var0`
BB1:
// top of stack will be seen as being var0
call
Because we first reach BB1 with the stack contents of var0, BB1 will end up accessing top of the stack as var0. However the type of var0 at this point is not Derived, since it can also be a Base object. We currently don't update the type of var0, but just update the type information of the top of stack entry when entering BB1. When inlining, after this commit, we use the type information from the stack, rather than the type of the var present on the stack.1 parent 26e8cc8 commit a04bc0c
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4998 | 4998 | | |
4999 | 4999 | | |
5000 | 5000 | | |
5001 | | - | |
| 5001 | + | |
5002 | 5002 | | |
5003 | 5003 | | |
5004 | 5004 | | |
| |||
0 commit comments