diff options
author | MyungJoo Ham <myungjoo.ham@samsung.com> | 2016-05-19 11:23:51 +0900 |
---|---|---|
committer | MyungJoo Ham <myungjoo.ham@samsung.com> | 2016-05-30 17:11:44 +0900 |
commit | 9458840b22e760771e2e14bade56b3f321bd8b5d (patch) | |
tree | af4b48e2e848abcf2d4e5c78d2be94a14eac5b7b /src/pal | |
parent | 457b8fcaa67aac2f67bd7622c6503e2d7b230cb8 (diff) | |
download | coreclr-9458840b22e760771e2e14bade56b3f321bd8b5d.tar.gz coreclr-9458840b22e760771e2e14bade56b3f321bd8b5d.tar.bz2 coreclr-9458840b22e760771e2e14bade56b3f321bd8b5d.zip |
ARM/THUMB PC Least Bit Set for Range Check
Fix #4859
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Diffstat (limited to 'src/pal')
-rw-r--r-- | src/pal/src/thread/context.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pal/src/thread/context.cpp b/src/pal/src/thread/context.cpp index 384c7c8e62..d644e0d1eb 100644 --- a/src/pal/src/thread/context.cpp +++ b/src/pal/src/thread/context.cpp @@ -488,6 +488,12 @@ void CONTEXTFromNativeContext(const native_context_t *native, LPCONTEXT lpContex if ((contextFlags & CONTEXT_CONTROL) == CONTEXT_CONTROL) { ASSIGN_CONTROL_REGS +#ifdef _ARM_ + // WinContext assumes that the least bit of Pc is always 1 (denoting thumb) + // although the pc value retrived from native context might not have set the least bit. + // This becomes especially problematic if the context is on the JIT_WRITEBARRIER. + lpContext->Pc |= 0x1; +#endif } if ((contextFlags & CONTEXT_INTEGER) == CONTEXT_INTEGER) |