Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

[x86/Linux] Fix RtlRestoreContext#8916

Merged
janvorli merged 2 commits into
dotnet:masterfrom
parjong:fix/RtlRestoreContext
Jan 19, 2017
Merged

[x86/Linux] Fix RtlRestoreContext#8916
janvorli merged 2 commits into
dotnet:masterfrom
parjong:fix/RtlRestoreContext

Conversation

@parjong
Copy link
Copy Markdown

@parjong parjong commented Jan 12, 2017

The current implementation of RtlRestoreContext for x86/Linux is incorrect. which results in segfault discussed in #8887.

This commit re-implements RtlRestoreContext to resolve #8887.

@parjong
Copy link
Copy Markdown
Author

parjong commented Jan 12, 2017

\CC @seanshpark

Comment thread src/pal/src/arch/i386/context2.S Outdated
push ecx
mov ecx, [eax + CONTEXT_Eax]
push ecx
push DWORD PTR [eax + CONTEXT_Edi]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we just load the registers from the context (doing the eax read as the last one) instead of pushing all of them and the popping?

Copy link
Copy Markdown
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@parjong
Copy link
Copy Markdown
Author

parjong commented Jan 18, 2017

@janvorli Could you merge this PR if there is no further issue?

@janvorli
Copy link
Copy Markdown
Member

@parjong I am sorry for the delay. I just wish github had a button "merge after successful CI".

@janvorli janvorli merged commit a6dccc8 into dotnet:master Jan 19, 2017
@parjong parjong deleted the fix/RtlRestoreContext branch January 19, 2017 00:23
@karelz karelz modified the milestone: 2.0.0 Aug 28, 2017
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* [x86/Linux] Fix RtlRestoreContext

* Use mov instead of push/pop


Commit migrated from dotnet/coreclr@a6dccc8
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[x86/Linux] Support Simple Exception Catch

4 participants