Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(752)

Unified Diff: src/wasm/wasm-module.cc

Issue 2273303002: [WASM] Adding fuzzing binaries for wasm, and script to update them. (Closed)
Patch Set: Fix Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/wasm/wasm-module.h ('k') | test/fuzzer/wasm.tar.gz.sha1 » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-module.cc
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc
index 13773f21bedc2f4a4d0acef219e307012ba2d1f9..0c457393bcb9bc92d257f0a4a9d6831b4e8f4b8c 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -1664,15 +1664,21 @@ int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start,
Handle<JSArrayBuffer>::null())
.ToHandleChecked();
- return CallFunction(isolate, instance, &thrower, "main", 0, nullptr);
+ return CallFunction(isolate, instance, &thrower, asm_js ? "caller" : "main",
+ 0, nullptr, asm_js);
}
int32_t CallFunction(Isolate* isolate, Handle<JSObject> instance,
ErrorThrower* thrower, const char* name, int argc,
- Handle<Object> argv[]) {
- Handle<Name> exports = isolate->factory()->InternalizeUtf8String("exports");
- Handle<JSObject> exports_object = Handle<JSObject>::cast(
- JSObject::GetProperty(instance, exports).ToHandleChecked());
+ Handle<Object> argv[], bool asm_js) {
+ Handle<JSObject> exports_object;
+ if (asm_js) {
+ exports_object = instance;
+ } else {
+ Handle<Name> exports = isolate->factory()->InternalizeUtf8String("exports");
+ exports_object = Handle<JSObject>::cast(
+ JSObject::GetProperty(instance, exports).ToHandleChecked());
+ }
Handle<Name> main_name = isolate->factory()->NewStringFromAsciiChecked(name);
PropertyDescriptor desc;
Maybe<bool> property_found = JSReceiver::GetOwnPropertyDescriptor(
« no previous file with comments | « src/wasm/wasm-module.h ('k') | test/fuzzer/wasm.tar.gz.sha1 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698