Repository navigation
Commit 0b9fe0c
committed
Read interpreter slots as raw Object pointers
On a Checked build the OBJECTREF copy constructor and operator->
validate the address they read from against Thread::dangerousObjRefs.
Interpreter stack slots are reported to the GC through the
interpreter's GC info and are written and reused without the checked
OBJECTREF lifecycle, so an entry the table holds for one of those
addresses (here left by GCFrame::Remove after
CreateCustomAttributeInstance unregistered its argument storage, then
marked at a possible GC point) is tripped by a later, unrelated read:
Thread::IsObjRefValid(this) asserts in OBJECTREF::operator-> at an
interpreted virtual call.
Read and write object references in interpreter stack slots as raw
Object pointers (LOCAL_VAR_OBJREF / SET_LOCAL_VAR_OBJREF), converting
to and from native OBJECTREF locals, which keep the usual checking; do
the same in InterpreterCodeManager::GetInstance and in the debugger's
function-evaluation argument read, whose address can be an interpreter
slot. The two paths that passed a slot's address as an OBJECTREF* to
GetMethodDescOfVirtualizedCode (the CALLVIRT dispatch-cache miss and
the open virtual delegate resolution) pass a GC-protected native local
instead. The slot-access conversions preserve Release behavior;
virtual call target resolution now protects a native receiver local in
all runtime builds.
Restore GCFrame::Remove, which an earlier revision of this change had
altered, and update the regression test's explanation.
Fix #1355351 parent 6918cfe commit 0b9fe0c
6 files changed
Lines changed: 112 additions & 87 deletions
File tree
- src
- coreclr
- debug/ee
- vm
- tests/Regressions/coreclr/GitHub_135535
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1535 | 1535 | | |
1536 | 1536 | | |
1537 | 1537 | | |
1538 | | - | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
1539 | 1541 | | |
1540 | 1542 | | |
1541 | 1543 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2311 | 2311 | | |
2312 | 2312 | | |
2313 | 2313 | | |
2314 | | - | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
2315 | 2317 | | |
2316 | 2318 | | |
2317 | 2319 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1293 | 1293 | | |
1294 | 1294 | | |
1295 | 1295 | | |
1296 | | - | |
1297 | | - | |
1298 | | - | |
1299 | | - | |
1300 | | - | |
| 1296 | + | |
| 1297 | + | |
1301 | 1298 | | |
1302 | 1299 | | |
1303 | 1300 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1721 | 1721 | | |
1722 | 1722 | | |
1723 | 1723 | | |
1724 | | - | |
1725 | | - | |
| 1724 | + | |
1726 | 1725 | | |
1727 | 1726 | | |
1728 | 1727 | | |
| |||
0 commit comments