diff options
author | Alon Zakai <azakai@google.com> | 2022-01-12 13:17:50 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-12 21:17:50 +0000 |
commit | 29604f1a7e9ef9dcc2825f076849cd6a452a8a19 (patch) | |
tree | c4d8b432f10c675122463342ecd89280468ff8c5 /test/ctor-eval/ignore-external-input.wast.ctors | |
parent | 10b1ad720d5f5c991cd7049f8650011d89869f60 (diff) | |
download | binaryen-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 'test/ctor-eval/ignore-external-input.wast.ctors')
-rw-r--r-- | test/ctor-eval/ignore-external-input.wast.ctors | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/ctor-eval/ignore-external-input.wast.ctors b/test/ctor-eval/ignore-external-input.wast.ctors index c7060ede5..7b57e4b82 100644 --- a/test/ctor-eval/ignore-external-input.wast.ctors +++ b/test/ctor-eval/ignore-external-input.wast.ctors @@ -1 +1 @@ -test1,test2,test3 +test1,test2,test2b,test3 |