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

Unified Diff: src/asmjs/asm-typer.cc

Issue 2641513003: [wasm][asm.js] Check if a property key is a PropertyName before assumming it. (Closed)
Patch Set: fix Created 3 years, 11 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 | « no previous file | test/mjsunit/asm/regress-681707.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/asmjs/asm-typer.cc
diff --git a/src/asmjs/asm-typer.cc b/src/asmjs/asm-typer.cc
index 2389551872a8b5e5f63e0da907b1a4aeff1e3f86..503bbaee398f667c68c58317a4a41efa9ae657cb 100644
--- a/src/asmjs/asm-typer.cc
+++ b/src/asmjs/asm-typer.cc
@@ -385,6 +385,10 @@ AsmTyper::VariableInfo* AsmTyper::ImportLookup(Property* import) {
return obj_info;
}
+ if (!key->IsPropertyName()) {
+ return nullptr;
+ }
+
std::unique_ptr<char[]> aname = key->AsPropertyName()->ToCString();
ObjectTypeMap::iterator i = stdlib->find(std::string(aname.get()));
if (i == stdlib->end()) {
« no previous file with comments | « no previous file | test/mjsunit/asm/regress-681707.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698