<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi,<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">Am 14.03.2018 um 10:43 schrieb Sebastian M. Ernst <<a href="mailto:ernst@pleiszenburg.de" class="">ernst@pleiszenburg.de</a>>:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi everyone,<br class=""><br class="">I'd like to draw you attention to an bizarre issue I am experiencing:<br class=""><a href="https://stackoverflow.com/q/49282888/1672565" class="">https://stackoverflow.com/q/49282888/1672565</a><br class=""></div></div></blockquote></div>The calling convention mismatch that is explained in the comments sounds like a good guess to me because CDECL and STDCALL have different ideas on who cleans up the stack. The value of 'i' will be pushed to the stack before the call, but both conveyor_belt (because it is STDCALL) and the caller (because it thinks conveyor_belt is CDECL) will pop the call arguments, and eventually you'll pop something into i that is larger than len.</div><div class=""><br class=""></div></body></html>