Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/drupal/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C Visual Studio optimizer在添加一些内联程序集代码后崩溃_C_Inline Assembly - Fatal编程技术网

C Visual Studio optimizer在添加一些内联程序集代码后崩溃

C Visual Studio optimizer在添加一些内联程序集代码后崩溃,c,inline-assembly,C,Inline Assembly,在此之前,我的代码中有asm块,但我想做一些更改 我有一个裸函数,它截获了一个API调用并修改了其中一个参数。 为此,我从堆栈中弹出所有参数,修改目标并将它们推回 我不想再像那样与堆栈交互了,我尝试了这个 __asm { // make the stack frame push ebp mov ebp, esp mov eax, [ebp + 8] mov param0, eax }; // here I modify param0 __asm {

在此之前,我的代码中有asm块,但我想做一些更改

我有一个裸函数,它截获了一个API调用并修改了其中一个参数。 为此,我从堆栈中弹出所有参数,修改目标并将它们推回

我不想再像那样与堆栈交互了,我尝试了这个

__asm
{
    // make the stack frame
    push ebp
    mov ebp, esp

    mov eax, [ebp + 8]
    mov param0, eax
};

// here I modify param0
__asm
{
    mov eax, param0
    mov [ebp + 8], eax // accessing parameters the right way
    jmp continueAdr // this gives control back to the hooked function
};
这给了我一个“Microsoft(R)C/C++优化编译器已停止工作”。 它告诉我“环顾”某一行代码,但这是在一个完全不同的函数中,与此无关。
我如何解决这个问题?还是该代码有问题?

编译器崩溃可能是编译器中的错误,或者是某个文件或缓存损坏。除此之外,
param0
实际上指向返回地址-第一个参数实际上位于
[ebp+8]
@DrewMcGowen我认为这是一个编译器错误-我将u asm块划分为更小的块(我这样做时也看到了返回地址的错误),它停止了抱怨。