Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement NativeLibrary.GetEntryPointModuleHandle #57610
Implement NativeLibrary.GetEntryPointModuleHandle #57610
Changes from all commits
e4e799c
5f16ec8
e0542ee
57643bc
4843165
376cd45
d19ed4a
d50f07f
d338682
3710af5
93fc783
58554e0
952903e
9087136
071b119
af32231
d71bc7b
4db27cb
5c61dfb
9c41825
5f36838
e9b70ae
4d58716
31fe53b
19bd0a9
b31fd00
d191560
745c9bc
efc285f
3f020e8
c9a9dba
7ffac68
a175e5c
81f9daa
a6117ba
2d4959a
f17ec5a
b8aa4fe
4e7a69c
c58228b
6bc7f4c
4266aab
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has potential race condition depending on how the C++ decides to compile it. The C/C++ compiler is free to reorder the if check and reading of
g_defaultSearchOrderPseudoHandle
to return. It means that the method can return NULL instead of the actual value.This is real problem. We had many bugs like that over the years - they are always very hard to trace down.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be fixed by making
g_defaultSearchOrderPseudoHandle
volatile, correct?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup. Also, you may want to cache the value in a local so that it does not need to be fetched from memory twice.