All bits in the union returned by make_temp_reg
should be initialised
#1551
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
make_temp_reg
returnsMVMSpeshOperand
, which is a union between varioustypes and structs, all of which are 64 bits or smaller.
Code in
optimize_bb_switch
evaluateslit_i64 != -1
before callingMVM_spesh_manipulate_release_temp_reg
. The struct within the union returnedfrom
make_temp_reg
is only 48 bits, so take care to ensure that the other16 bits are initialised, else valgrind (correctly) complains that
"Conditional jump or move depends on uninitialised value(s)".
(To be fair, technically the subsequent code shouldn't be reading the union
using a different member than it was written with. If compilers are going to
get exacting about this - ie infer that writing the
lit_i64
member can becompletely eliminated - then we will need to change the struct within the
union to be exactly 64 bits in total.)