summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/execution-results.h12
-rw-r--r--src/tools/wasm-ctor-eval.cpp4
2 files changed, 16 insertions, 0 deletions
diff --git a/src/tools/execution-results.h b/src/tools/execution-results.h
index a183ad93b..50f627baf 100644
--- a/src/tools/execution-results.h
+++ b/src/tools/execution-results.h
@@ -90,6 +90,9 @@ struct ExecutionResults {
std::map<Name, Literals> results;
Loggings loggings;
+ // If set, we should ignore this and not compare it to anything.
+ bool ignore = false;
+
// get results of execution
void get(Module& wasm) {
LoggingExternalInterface interface(loggings);
@@ -176,6 +179,10 @@ struct ExecutionResults {
}
bool operator==(ExecutionResults& other) {
+ if (ignore || other.ignore) {
+ std::cout << "ignoring comparison of ExecutionResults!\n";
+ return true;
+ }
for (auto& iter : other.results) {
auto name = iter.first;
if (results.find(name) == results.end()) {
@@ -231,6 +238,11 @@ struct ExecutionResults {
return instance.callFunction(func->name, arguments);
} catch (const TrapException&) {
return {};
+ } catch (const HostLimitException&) {
+ // This should be ignored and not compared with, as optimizations can
+ // change whether a host limit is reached.
+ ignore = true;
+ return {};
}
}
};
diff --git a/src/tools/wasm-ctor-eval.cpp b/src/tools/wasm-ctor-eval.cpp
index 6662dd176..2f7707853 100644
--- a/src/tools/wasm-ctor-eval.cpp
+++ b/src/tools/wasm-ctor-eval.cpp
@@ -312,6 +312,10 @@ struct CtorEvalExternalInterface : EvallingModuleInstance::ExternalInterface {
throw FailToEvalException(std::string("trap: ") + why);
}
+ void hostLimit(const char* why) override {
+ throw FailToEvalException(std::string("trap: ") + why);
+ }
+
void throwException(const WasmException& exn) override {
std::stringstream ss;
ss << "exception thrown: " << exn;