Fix appending elements for ecma collection (#3719)
During ecma_collection_append the underlying collection was not increased in the required case. This triggered a buffer overflow when processing the bound function's arguments during call or during the Proxy ownKeys method. JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
This commit is contained in:
@@ -149,6 +149,21 @@ var proxy = new Proxy(target, handler);
|
||||
|
||||
assert(JSON.stringify(Object.getOwnPropertyNames(proxy)) === '["a","a","a"]');
|
||||
|
||||
// test with lots of keys
|
||||
var keyslist = [];
|
||||
|
||||
var handler = {
|
||||
ownKeys: function(target) {
|
||||
for (var idx = 0; idx < 30; idx++) {
|
||||
keyslist.push("K" + idx);
|
||||
}
|
||||
return keyslist;
|
||||
}
|
||||
};
|
||||
|
||||
var proxy = new Proxy(target, handler);
|
||||
assert(JSON.stringify(Object.getOwnPropertyNames(proxy)) === JSON.stringify(keyslist));
|
||||
|
||||
// test when invariants gets violated
|
||||
var target = {
|
||||
"target_one": 1
|
||||
|
||||
Reference in New Issue
Block a user