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

Unified Diff: src/code-stub-assembler.cc

Issue 2580413002: Merged: [stubs] Fix negative index lookup in hasOwnProperty (Closed)
Patch Set: fix formatting Created 4 years 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/builtins/builtins-object.cc ('k') | test/mjsunit/regress/regress-crbug-673008.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.cc
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
index 2102cbe03c7bb2a5051af335e26472b260960643..fb5ce14b1ce7d5a0dfe1de153fe64f8af5e72e01 100644
--- a/src/code-stub-assembler.cc
+++ b/src/code-stub-assembler.cc
@@ -4685,6 +4685,9 @@ void CodeStubAssembler::TryLookupElement(Node* object, Node* map,
}
Bind(&if_isdictionary);
{
+ // Negative keys must be converted to property names.
+ GotoIf(IntPtrLessThan(intptr_index, IntPtrConstant(0)), if_bailout);
+
Variable var_entry(this, MachineType::PointerRepresentation());
Node* elements = LoadElements(object);
NumberDictionaryLookup<SeededNumberDictionary>(
« no previous file with comments | « src/builtins/builtins-object.cc ('k') | test/mjsunit/regress/regress-crbug-673008.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698