Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Fix Issue 22218 - Dynamic casts across binary boundaries can easily fail #3543

Merged
merged 8 commits into from
Aug 20, 2021

Conversation

kinke
Copy link
Contributor

@kinke kinke commented Aug 16, 2021

A rebase/reboot of #2828.

@dlang-bot
Copy link
Contributor

dlang-bot commented Aug 16, 2021

Thanks for your pull request and interest in making D better, @kinke! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
22218 major Dynamic casts across binary boundaries can easily fail

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + druntime#3543"

src/rt/cast_.d Outdated
{
if (a is b)
return true;
return (a && b) && a.name == b.name;
Copy link
Contributor Author

@kinke kinke Aug 16, 2021

Choose a reason for hiding this comment

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

Not sure

  • whether the null-checks are really required here, or are better moved to the few call sites potentially passing a null, (edit: moved)
  • whether the extra name check should be restricted to shared druntime (*.{so,dll}) only, in order not to slow down dynamic casts with static druntime, assuming static druntime isn't used for multiple D binaries in a process (with Windows exception for DMD) - see Fix exceptions and dynamic casts across dll boundaries #2828 (comment).

@kinke kinke marked this pull request as ready for review August 16, 2021 07:03
@kinke kinke changed the title Fix exceptions and dynamic casts across dll boundaries (rebase of #2828) Fix Issue 22218 - Dynamic casts across binary boundaries can easily fail Aug 16, 2021
Actually fixed by the previous commits, just fixing up the rt.cast_
compile errors after the rebase.
EH across DLLs needs more work with DMD on Win64, see
dlang#2874.
@dlang-bot dlang-bot added the Bug Fix Include reference to corresponding bugzilla issue label Aug 16, 2021
@RazvanN7 RazvanN7 added 72h no objection -> merge The PR will be merged if there are no objections raised. and removed 72h no objection -> merge The PR will be merged if there are no objections raised. labels Aug 17, 2021
@RazvanN7 RazvanN7 merged commit a8df891 into dlang:master Aug 20, 2021
@kinke kinke deleted the dynamic_cast branch August 20, 2021 07:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Fix Include reference to corresponding bugzilla issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants