Don't use combined_id in constexpr functions to avoid union cast.

This commit is contained in:
Can Bölük 2020-08-16 00:15:36 +02:00
parent b609646564
commit 305c2a764d

View file

@ -262,7 +262,7 @@ namespace vtil
//
constexpr bool overlaps( const register_desc& o ) const
{
if ( combined_id != o.combined_id || flags != o.flags )
if ( local_id != o.local_id || architecture != o.architecture || flags != o.flags )
return false;
return get_mask() & o.get_mask();
}
@ -271,7 +271,7 @@ namespace vtil
//
constexpr register_desc select( bitcnt_t new_bit_count, bitcnt_t new_bit_offset ) const
{
return { weaken(), new_bit_count, new_bit_offset };
return { flags, local_id, new_bit_count, new_bit_offset, architecture };
}
constexpr register_desc rebase( bitcnt_t new_bit_offset ) const
{