Merge pull request #3011 from hbatagelo/fix_type_punning_ub