diff options
author | juj <jujjyl@gmail.com> | 2022-09-13 19:57:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-13 16:57:37 +0000 |
commit | f1a3e682e864fcb827a01d3c5725d847053fe149 (patch) | |
tree | 382db6a2522ec5a523f964f039bcbc477e84184b /src | |
parent | 6a4fafe4fe9468acb6ee959804b5753fa1d63d7c (diff) | |
download | binaryen-f1a3e682e864fcb827a01d3c5725d847053fe149.tar.gz binaryen-f1a3e682e864fcb827a01d3c5725d847053fe149.tar.bz2 binaryen-f1a3e682e864fcb827a01d3c5725d847053fe149.zip |
Improve ExtractFunction pass error printing (#4747)
* Improve ExtractFunction pass error printing.
* Update lint
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/ExtractFunction.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/passes/ExtractFunction.cpp b/src/passes/ExtractFunction.cpp index 0939ebe28..f75c04cbe 100644 --- a/src/passes/ExtractFunction.cpp +++ b/src/passes/ExtractFunction.cpp @@ -80,10 +80,11 @@ struct ExtractFunctionIndex : public Pass { } Index i = std::stoi(index); if (i >= module->functions.size()) { - Fatal() << "Invalid function index"; + Fatal() << "Out of bounds function index " << i << "! (module has only " + << module->functions.size() << " functions)"; } // Assumes imports are at the beginning - Name name = module->functions[std::stoi(index)]->name; + Name name = module->functions[i]->name; extract(runner, module, name); } }; |