14d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org// Copyright 2011 the V8 project authors. All rights reserved.
24d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org// Redistribution and use in source and binary forms, with or without
34d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org// modification, are permitted provided that the following conditions are
44d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org// met:
54d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org//
64d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org//     * Redistributions of source code must retain the above copyright
74d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org//       notice, this list of conditions and the following disclaimer.
84d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org//     * Redistributions in binary form must reproduce the above
94d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org//       copyright notice, this list of conditions and the following
104d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org//       disclaimer in the documentation and/or other materials provided
114d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org//       with the distribution.
124d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org//     * Neither the name of Google Inc. nor the names of its
134d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org//       contributors may be used to endorse or promote products derived
144d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org//       from this software without specific prior written permission.
154d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org//
164d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
174d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
184d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
194d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
204d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
214d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
224d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
234d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
244d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
254d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
264d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
274d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org
284d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org// Should not crash.
294d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.org
304d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.orgpattern = RegExp("","");  // RegExp is irrelevant, as long as it's not an atom.
314d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.orgstring = 'a';             // Anything non-empty (flat ASCII).
324d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.orgpattern.exec(string);     // Ensure that JSRegExp is compiled.
334d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.orgpattern["@"] = 42;        // Change layout of JSRegExp object.
344d3fe4e246b0312eba361689f288ddf8dd516960danno@chromium.orgpattern.exec(string);     // Call again to trigger bug in stub.
35