如果函数执行,计数器将递增,但执行它必须不是空的。只有在执行前执行函数时才会发生。使我困惑的是什么。Ie:如果你已经定义了函数-AdDR,那么当调用主α1时,如果添加了一个间接函数调用,当调用时,第3个问题是第1个问题。它总是接收0x000,除非你提出一个调用先前函数(α2)或间接(α3)的句子。如果我定义了一个函数,并把它传递给一个函数,我希望它有地址,而不是0x000。看起来编译器正在优化它(如果我不记得其他线程坏了),并且因为函数不直接使用,并且没有直接分配给函数指针,所以它不被使用。所以…远离的。但我不确定是不是这样,或者是另一回事。因为禁用优化不会改变任何东西。PS:我讨厌脚本服务器…必须编辑5次才能“正确”。
以上来自于百度翻译
以下为原文
The counter increments if the function executes, but to execute it must be not NULL.. and it only happens if the function is executed before asigning... what puzzles me. Ie:
If you have defined function_addr as follow,
void function_addr (const void * data)
{
ufun.addr = data;
}
When calling in main
#1
main()
{
function_addr(f1) -> it receives NULL
}
#2
main
{
f1()
function_addr(f1) -> it receives the correct address
}
Now, if an indirect function call is added as,
void function_addr (const void * data)
{
ufun.addr = data;
ufun.function(); <----
}
When calling,
#3
main()
{
function_addr(f1) -> Receives correct address.
}
The problem is #1. It always receives 0x0000 unless you place a sentence calling the function previously (#2) or indirectly (#3). If I have a function defined and I pass it to a function I expect having the address, not 0x0000. Looks the compiler is optimizing it (if I dont remember bad from other threads), and since the function is not used directly and not assigned to a function pointer directly, it's "not" used.. so... removed. But I'm not sure if it is the case or is a different thing., since disabling optimizations does not change anything.
PS: I hate the script server.... had to edit 5 times to be "correct".
如果函数执行,计数器将递增,但执行它必须不是空的。只有在执行前执行函数时才会发生。使我困惑的是什么。Ie:如果你已经定义了函数-AdDR,那么当调用主α1时,如果添加了一个间接函数调用,当调用时,第3个问题是第1个问题。它总是接收0x000,除非你提出一个调用先前函数(α2)或间接(α3)的句子。如果我定义了一个函数,并把它传递给一个函数,我希望它有地址,而不是0x000。看起来编译器正在优化它(如果我不记得其他线程坏了),并且因为函数不直接使用,并且没有直接分配给函数指针,所以它不被使用。所以…远离的。但我不确定是不是这样,或者是另一回事。因为禁用优化不会改变任何东西。PS:我讨厌脚本服务器…必须编辑5次才能“正确”。
以上来自于百度翻译
以下为原文
The counter increments if the function executes, but to execute it must be not NULL.. and it only happens if the function is executed before asigning... what puzzles me. Ie:
If you have defined function_addr as follow,
void function_addr (const void * data)
{
ufun.addr = data;
}
When calling in main
#1
main()
{
function_addr(f1) -> it receives NULL
}
#2
main
{
f1()
function_addr(f1) -> it receives the correct address
}
Now, if an indirect function call is added as,
void function_addr (const void * data)
{
ufun.addr = data;
ufun.function(); <----
}
When calling,
#3
main()
{
function_addr(f1) -> Receives correct address.
}
The problem is #1. It always receives 0x0000 unless you place a sentence calling the function previously (#2) or indirectly (#3). If I have a function defined and I pass it to a function I expect having the address, not 0x0000. Looks the compiler is optimizing it (if I dont remember bad from other threads), and since the function is not used directly and not assigned to a function pointer directly, it's "not" used.. so... removed. But I'm not sure if it is the case or is a different thing., since disabling optimizations does not change anything.
PS: I hate the script server.... had to edit 5 times to be "correct".
举报