Skip to content

Commit fb217c8

Browse files
authored
Show the unescaped name in Asyncify pattern warnings (#2351)
This is part of the fix for https://logs.chromium.org/logs/emscripten-releases/buildbucket/cr-buildbucket.appspot.com/8901492015302662960/+/steps/Emscripten_testsuite__upstream__other_/0/stdout Specifically it fixes that the name shown there should not be escaped. Followup for #2344
1 parent bf7e40f commit fb217c8

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/passes/Asyncify.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ class PatternMatcher {
340340
std::set<Name> names;
341341
std::set<std::string> patterns;
342342
std::set<std::string> patternsMatched;
343+
std::map<std::string, std::string> unescaped;
343344

344345
PatternMatcher(std::string designation,
345346
Module& module,
@@ -349,8 +350,9 @@ class PatternMatcher {
349350
// internal escaped names for later comparisons
350351
for (auto& name : list) {
351352
auto escaped = WasmBinaryBuilder::escape(name);
353+
unescaped[escaped.str] = name;
352354
if (name.find('*') != std::string::npos) {
353-
patterns.insert(std::string(escaped.str));
355+
patterns.insert(escaped.str);
354356
} else {
355357
auto* func = module.getFunctionOrNull(escaped);
356358
if (!func) {
@@ -386,8 +388,8 @@ class PatternMatcher {
386388
for (auto& pattern : patterns) {
387389
if (patternsMatched.count(pattern) == 0) {
388390
std::cerr << "warning: Asyncify " << designation
389-
<< "list contained a non-matching pattern: " << pattern
390-
<< "\n";
391+
<< "list contained a non-matching pattern: "
392+
<< unescaped[pattern] << " (" << pattern << ")\n";
391393
}
392394
}
393395
}

0 commit comments

Comments
 (0)