summaryrefslogtreecommitdiff
path: root/src/tools/wasm-shell.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2022-01-12 13:17:50 -0800
committerGitHub <noreply@github.com>2022-01-12 21:17:50 +0000
commit29604f1a7e9ef9dcc2825f076849cd6a452a8a19 (patch)
treec4d8b432f10c675122463342ecd89280468ff8c5 /src/tools/wasm-shell.cpp
parent10b1ad720d5f5c991cd7049f8650011d89869f60 (diff)
downloadbinaryen-29604f1a7e9ef9dcc2825f076849cd6a452a8a19.tar.gz
binaryen-29604f1a7e9ef9dcc2825f076849cd6a452a8a19.tar.bz2
binaryen-29604f1a7e9ef9dcc2825f076849cd6a452a8a19.zip
[ctor-eval] Eval functions with params if ignoring external input (#4446)
When ignoring external input, assume params have a value of 0. This makes it possible to eval main(argc, argv) if one is careful and does not actually use those values. This is basically a workaround for main always receiving argc/argv, even if the C code has no args (in that case the compiler emits __original_main for the user's main, and wraps it with a main that adds the args, hence the problem). This is similar to the existing support for handling wasi_args_get when ignoring external input, although it just sets values of zeros for the params. Perhaps it could check for main() specifically and return 1 for argc and a proper buffer for argv somehow, but I think if a program wants to use --ignore-external-input it can avoid actually reading argc/argv.
Diffstat (limited to 'src/tools/wasm-shell.cpp')
0 files changed, 0 insertions, 0 deletions