Function returns value without return statement

For x86 at least, the return value of this function should be in eax register. Anything that was there will be considered to be the return value by the caller.

Because eax is used as return register, it is often used as “scratch” register by callee, because it does not need to be preserved. This means that it’s very possible that it will be used as any of local variables. Because both of them are equal at the end, it’s more probable that the correct value will be left in eax.

Leave a Comment