Skip to content

Conversation

FAKERINHEART
Copy link

No description provided.

@ckormanyos
Copy link
Member

Hi @FAKERINHEART thanks for looking into this. Our workflow requires approvel for first-time contributors. I've just approved your CI workflow run so let's see how the CI tests run through.

Cc: @jzmaddock

Copy link

codecov bot commented Feb 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.1%. Comparing base (83d5844) to head (716eb0e).
Report is 2 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop    #657   +/-   ##
=======================================
  Coverage     94.1%   94.1%           
=======================================
  Files          279     279           
  Lines        28979   28979           
=======================================
  Hits         27253   27253           
  Misses        1726    1726           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83d5844...716eb0e. Read the comment docs.

@ckormanyos
Copy link
Member

ckormanyos commented Feb 24, 2025

Oh Also, @FAKERINHEART, do you have a test case that exercises this change to the for-loop?. That would be nice because then we could add the test case as well for the new lines.

@jzmaddock
Copy link
Collaborator

Actually... is there any reason not to just delete the whole outer loop? If we enter the loop then the condition that leads to the break will always be taken?

@ckormanyos
Copy link
Member

Actually... is there any reason not to just delete the whole outer loop? If we enter the loop then the condition that leads to the break will always be taken?

Do you mean to remove the outer while-loop at line $848$?

I agree @jzmaddock.

  • But then also remove the break; statement at line $853$ that, at the moment, breaks from the outer while-loop, right?
  • Do we need a range-check on offset + 1?

Cc: @FAKERINHEART

@FAKERINHEART
Copy link
Author

FAKERINHEART commented Feb 24, 2025

Oh Also, @FAKERINHEART, do you have a test case that exercises this change to the for-loop?. That would be nice because then we could add the test case as well for the new lines.

No, I think that it may be no needs to add a new test case. Please look into mpfr.hpp:431, and its commit log: 485fa7c. It was fixed for the mpfr_float_imp<digits10, allocate_dynamic> three years ago, but it forgot to fix mpfr_float_imp<digits10, allocate_stack> which is for this merge case. They are in the same condition, and the previous has been add tests in the 485fa7c.

@FAKERINHEART
Copy link
Author

FAKERINHEART commented Feb 24, 2025

Actually... is there any reason not to just delete the whole outer loop? If we enter the loop then the condition that leads to the break will always be taken?

Do you mean to remove the outer while-loop at line 848 ?

I agree @jzmaddock.

  • But then also remove the break; statement at line
    853
    that, at the moment, breaks from the outer while-loop, right?
  • Do we need a range-check on offset + 1?

Cc: @FAKERINHEART

If we wanna remove the whole loop, please take its effect both to mpfr_float_imp<digits10, allocate_dynamic> and mpfr_float_imp<digits10, allocate_stack>.

@FAKERINHEART
Copy link
Author

CI has been passed.
Could we merge this PR please?
@ckormanyos

@jzmaddock
Copy link
Collaborator

Bare with me, I'm not convinced this is the correct fix (or indeed that there is an issue, as the whole loop appears to be a mistake that can never actually loop anyway), I need to investigate some more....

@jzmaddock
Copy link
Collaborator

My apologies: you're quite correct, I was completely misreading the code until I saw it with highlighting in my editor! My bad, will merge...

@jzmaddock jzmaddock merged commit ce3229e into boostorg:develop Feb 28, 2025
79 checks passed
@mborland
Copy link
Member

I'll merge this into master for 1.88 since we're still safe to do so

@FAKERINHEART
Copy link
Author

thx~

mborland added a commit that referenced this pull request Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants