fix strict aliasing rule violation
Merge pull request #2586 from cremno/fix-strict-aliasing-rule-violation

fix strict aliasing rule violation