blt4linux / blt4l

PAYDAY 2 SteamOS/Linux LUA loader.
Other
57 stars 14 forks source link

Fix dohttpreq randomly segfaulting when compiled on Clang #90

Closed ZNixian closed 6 years ago

ZNixian commented 6 years ago

When using dohttpreq on a copy of BLT4L compiled using Clang, the game will sometimes segfault (crash to desktop).

This is because Clang seems to be generating misaligned MOVAPS instructions when assigning a value to a member of the LUAHttpData struct, causing the segfaults.

Forcing the alignment of the first item in the first field of said struct seems to fix the issue; Testing 100 HTTP requests has not yet segfaulted.

ZNixian commented 6 years ago

@RomanHargrave Once this is merged, I'd recomend releasing a pre-release or bugfix release; Otherwise, PD2 will crash to desktop 9/10 times it opens.