Skip to content

Commit d7b7291

Browse files
committedJul 24, 2018
[1.10>master] [MERGE #5518 @VSadov] Relaxing an assert in TinyDictionary
Merge pull request #5518 from VSadov:tiny It is possible and ok for the `data` part of the dictionary to contain `FF`. The assert that we have in `TryGetValue` could get triggered if an unsuccessfull lookup goes through such value. The added test code does that, as an example.
2 parents 4964fc4 + a632b6f commit d7b7291

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed
 

‎lib/Runtime/Types/TypePath.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ namespace Js
8686
break;
8787
}
8888

89-
Assert(idx != (next[idx] & 127));
89+
Assert(next[idx] == NIL || (next[idx] & 127) != idx);
9090
i = next[idx];
9191
}
9292
}

‎test/Bugs/OS_17745531.js

+7
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ for (let j = 0; j < 127; j++)
4141
{
4242
console.log("fail");
4343
}
44+
45+
// just check for asserts when doing lookups
46+
for (let i = 0; i < 500; i++) {
47+
if (obj1['prop' + i] == "qq") {
48+
console.log("hmm");
49+
}
50+
}
4451
}
4552

4653
console.log("pass");

0 commit comments

Comments
 (0)
Please sign in to comment.