tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

regress-481436.js (980B)


      1 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this
      4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 //-----------------------------------------------------------------------------
      7 var BUGNUMBER = 481436;
      8 var summary = 'TM: Do not crash @ FlushNativeStackFrame/JS_XDRNewMem';
      9 var actual = '';
     10 var expect = '';
     11 
     12 
     13 printBugNumber(BUGNUMBER);
     14 printStatus (summary);
     15 
     16 
     17 function search(m, n) {
     18  if (m.name == n)
     19    return m;
     20  for (var i = 0; i < m.items.length; i++)
     21    if (m.items[i].type == 'M')
     22      search(m.items[i], n);
     23 }
     24 
     25 function crash() {
     26  for (var i = 0; i < 2; i++) {
     27    var root = {name: 'root', type: 'M', items: [{}]};
     28    search(root, 'x');
     29    root.items.push({name: 'tim', type: 'M', items: []});
     30    search(root, 'x');
     31    search(root, 'x');
     32  }
     33 }
     34 
     35 crash();
     36 
     37 
     38 reportCompare(expect, actual, summary);