Merge pull request #541 from marcelwa/acd-local-extend-shift-ub

ACD: 64-bit shift by 64 or more in local_extend_to
This commit is contained in:
alanminko 2026-08-16 01:48:58 +09:00 committed by GitHub
commit fe862d3647
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -1322,7 +1322,10 @@ private:
{
auto mask = *tt.begin();
for ( auto i = real_num_vars; i < num_vars; ++i )
/* Replicate within the word only. Variables 6 and above are replicated by the
* std::fill below, and shifting a 64-bit word by (1 << i) for i >= 6 is undefined
* behaviour rather than a no-op. */
for ( auto i = real_num_vars; i < std::min( num_vars, 6u ); ++i )
{
mask |= ( mask << ( 1 << i ) );
}