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

Fix Issue 21363 - [REG2.094] Implementation of core.bitop.ror(x,0) is… #3457

Merged
merged 1 commit into from May 2, 2021

Conversation

Chigusa0w0
Copy link
Contributor

… using UB

This is a quick fix to Issue 21363. When count is set to 0, T.sizeof * 8 - count will always be T.sizeof * 8 therefore fails compiler check here:
https://github.com/dlang/dmd/blob/81f9f57257da8733cf741355524bb8a3ec9c45ce/src/dmd/dinterpret.d#L3018-L3024

@dlang-bot
Copy link
Contributor

dlang-bot commented May 1, 2021

Thanks for your pull request and interest in making D better, @Chigusa0w0! 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
21363 regression [REG2.094] Implementation of core.bitop.ror(x,0) is using UB

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 "stable + druntime#3457"

@dlang-bot dlang-bot added the Bug Fix Include reference to corresponding bugzilla issue label May 1, 2021
@thewilsonator
Copy link
Contributor

please add the test case from the bug report

@Chigusa0w0
Copy link
Contributor Author

@thewilsonator Test cases added

@thewilsonator
Copy link
Contributor

finally can you retarget this PR to stable (follow the bot's instructions) and this should be good to go.

@Chigusa0w0 Chigusa0w0 force-pushed the patch-4 branch 2 times, most recently from c5f717f to 042c004 Compare May 2, 2021 02:17
@dlang-bot dlang-bot added the Enhancement New functionality label May 2, 2021
@Chigusa0w0 Chigusa0w0 changed the base branch from master to stable May 2, 2021 02:17
… using UB

This is a quick fix to Issue 21363. When `count` is set to `0`, `T.sizeof * 8 - count` will always be `T.sizeof * 8` therefore fails compiler check here:
https://github.com/dlang/dmd/blob/81f9f57257da8733cf741355524bb8a3ec9c45ce/src/dmd/dinterpret.d#L3018-L3024
@Chigusa0w0
Copy link
Contributor Author

@thewilsonator rebase done

@dlang-bot dlang-bot merged commit fdda230 into dlang:stable May 2, 2021
@Chigusa0w0 Chigusa0w0 deleted the patch-4 branch May 2, 2021 04:29
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 Enhancement New functionality
Projects
None yet
3 participants