This repository was archived by the owner on Oct 12, 2022. It is now read-only.
Fix for erroneous imported private symbols caused by bug 314 #32
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.
This pull request is required after dlang/dmd#163 is merged in.
Currently, in a few places in druntime, modules do private selective imports, which (due to bug 314) causes private symbols to be imported by other files, which in turn causes access protection errors (revealed by my other pull request).
Example:
core.runtime privately and selectively imports core.stdc.stdlib.free and core.stdc.string.strlen. Due to bug 314, this causes free and strlen to become private symbols of core.runtime, rather than imported symbols.
Now, core.sys.windows.stracktrace imports core.runtime (as well as stdc.stdlib and stdc.string), which causes the private symbols free and strlen to be imported. When stacktrace tries to use free and strlen unqualified, you get an access error because they are private.
This change explicitly qualifies the calls to free and strlen so that it doesn't use the private ones unexpectedly (and erroneously) imported from core.runtime.
Bug 314: http://d.puremagic.com/issues/show_bug.cgi?id=314
(Edit) : Just to be clear, this pull request does not fix bug 314, or any other reported bug for that matter. It simply works around some things caused by bug 314 that were revealed after implementing module level protection. The link is simply for convenience.