Skip to content

Change arg to const & to avoid MSan issue.#2415

Merged
alecjacobson merged 1 commit intomainfrom
jdumas/msan
Sep 27, 2024
Merged

Change arg to const & to avoid MSan issue.#2415
alecjacobson merged 1 commit intomainfrom
jdumas/msan

Conversation

@jdumas
Copy link
Copy Markdown
Collaborator

@jdumas jdumas commented Sep 26, 2024

I'm trying to make my code run fine through MemorySanitizer. I'm running into a case where the look_left/right routines might call set_min() with an uninitialized i_left/i_right index. This is fine because set_min() is called with sqr_d_candidate == sqr_d, so the uninitialized index is never assigned. But changing the arg to a const & avoids reading the value from memory and thus makes MemorySanitizer happy.

@alecjacobson alecjacobson merged commit fac5d4a into main Sep 27, 2024
@alecjacobson alecjacobson deleted the jdumas/msan branch September 27, 2024 11:52
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.

2 participants