Thanks to visit codestin.com
Credit goes to github.com

Skip to content

properly initialize variable when building IREmitterContext#4535

Merged
froydnj merged 1 commit intomasterfrom
froydnj-fix-iremitter-context
Aug 25, 2021
Merged

properly initialize variable when building IREmitterContext#4535
froydnj merged 1 commit intomasterfrom
froydnj-fix-iremitter-context

Conversation

@froydnj
Copy link
Contributor

@froydnj froydnj commented Aug 25, 2021

Motivation

We weren't properly initializing this variable along all paths. Luckily (?), not initializing this variable only made the compiler's output less deterministic and also simply made us do a little extra work at runtime.

Test plan

See included automated tests.

@froydnj froydnj requested a review from a team as a code owner August 25, 2021 20:30
@froydnj froydnj requested review from jez and removed request for a team August 25, 2021 20:30
@froydnj
Copy link
Contributor Author

froydnj commented Aug 25, 2021

We have a policy of testing changes to Sorbet against Stripe's codebase before
merging them. I've kicked off a test run for the current PR. When the build
finishes, I'll share with you whether or how it failed. Thanks!

Stripe employees can see the build results here:

https://go/builds/bui_K6g8rSqhTc3jkr
https://go/builds/bui_K6g8jwjY5E3lTZ

@jez
Copy link
Collaborator

jez commented Aug 25, 2021

I would love to find a compiler flag that makes this into a warning or an error, btw.

@froydnj
Copy link
Contributor Author

froydnj commented Aug 25, 2021

I would love to find a compiler flag that makes this into a warning or an error, btw.

This is -Wmaybe-uninitialized and it tends to be very noisy, but maybe it would be OK in Sorbet?

@froydnj froydnj merged commit 5370358 into master Aug 25, 2021
@froydnj froydnj deleted the froydnj-fix-iremitter-context branch August 25, 2021 20:56
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.

3 participants

Comments