Created
March 21, 2014 22:06
-
-
Save derrickturk/9697487 to your computer and use it in GitHub Desktop.
Death by misalignment...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public service announcement: use extreme caution when compiling under g++ with -msseX and returning a std::pair<double, double>, or the structural equivalent, by value. It will optimize to a movapd, which works wonderfully as long as you're returning into a 16-bit aligned address. But you'll mysteriously explode in a shower of body parts if calling into, say, a DLL from external code (say, Excel VBA) with a less-strictly aligned stack. | |
No, I didn't just spend 5 hours tracking that one down... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment