If the last function parameter is a float it is passed via the stack and not via EAX. # The last parameter is passed in EAX rather than being pushed on # the stack if the following conditions are met: # # * It fits in EAX. # * It is not a 3 byte struct. missing condition: # * not a float/ifloat # void test(float f){ # assert(16.5 == f); # } # # void main(){ # float f = 16.5; # int i = *cast(int*)&f; # version(bug){ # asm{ # mov EAX, i; # call test; # } # }else{ # asm{ # push i; # call test; # pop i; # } # } # } dmd test.d && ./test && echo OK > OK dmd -version=bug test.d && ./test && echo OK > Error: AssertError Failure bug.d(2)
Nitpick: that "pop i" after the call in the else clause shouldn't be there. D functions pop their own arguments, except in case of varargs.
Fixed DMD 1.009
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル