Closed Chocolatieee0929 closed 2 months ago
please check your compiler's documentation, this is not a wabt issue.
Using an uninitialised variable is Undefined Behaviour in C/C++, and the C compiler is licensed to do whatever it wants, including launching missiles. This is unrelated to Wasm.
Thanks for your answer.
When I was trying to write EOS contract, which use wasm to compilered, I found that uninitialized local var seem to be optimised. For example, the result, when added to any number and uninitialized local variable
a1
, is printed as zero. The test code as follows:test result :
The compiled data as follows indicates that there is a local.get operation without any accompanying store operation. Please tell me if my thought is right, thks