cat > bug.d << CODE void checkAlign() { asm { naked; mov RDI, RSP; and RDI, 0xF; cmp RDI, 0x8; je Lpass; hlt; Lpass: ret; } } void foo() { } void main() { checkAlign(); scope(exit) checkAlign(); foo(); } CODE dmd -run bug ---- The scope exit pushes the address of the return block onto the stack which breaks the stack alignment.
https://github.com/D-Programming-Language/dmd/pull/988 This bug affects all calls from a finally block that require an aligned stack. The "optimization" is also a huge performance hog. Abusing return as indirect jump always incurs a branch misprediction.
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/4e8cc86f5acc600511a4e12caab802b99d836c9b fix Issue 8199 - stack is not aligned in finally block
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/2b3a94d50f2d31410c9a1f70dfb5ead7f31b4a27 fix Issue 8199 - stack is not aligned in finally block
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル