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

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

Issue 2568943002: [stubs] Fix negative index lookup in hasOwnProperty (Closed)
Patch Set: add test 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 248d8a80e6783ecf4161fad2dde15c9a300e399a..41d3565516ba68f0e89a0711f4afd72b603b5e8f 100644
--- a/src/code-stub-assembler.cc
+++ b/src/code-stub-assembler.cc
@@ -5084,6 +5084,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