Bug 1028613 - Modify the x86 MSVC implementation of NS_InvokeByIndex to make it compatible with clang-cl; r=bsmedberg

This commit is contained in:
Ehsan Akhgari 2014-06-23 10:29:21 -07:00
parent a007389621
commit e9ec75fce7

View File

@ -67,8 +67,14 @@ noparams:
push ecx // push this
mov edx,[ecx] // vtable in edx
mov eax,methodIndex
call [edx][eax*4] // stdcall, i.e. callee cleans up stack.
call dword ptr[edx+eax*4] // stdcall, i.e. callee cleans up stack.
mov esp,ebp
// clang-cl doesn't emit the pop and ret instructions because it doesn't realize
// that the call instruction sets a return value in eax. See
// https://bugzilla.mozilla.org/show_bug.cgi?id=1028613 and
// http://llvm.org/bugs/show_bug.cgi?id=17201.
pop ebp
ret
}
}
#pragma warning(default : 4035) // restore default