| Index: test/mjsunit/regress/regress-392114.js
|
| diff --git a/test/mjsunit/regress/regress-frame-details-null-receiver.js b/test/mjsunit/regress/regress-392114.js
|
| similarity index 66%
|
| copy from test/mjsunit/regress/regress-frame-details-null-receiver.js
|
| copy to test/mjsunit/regress/regress-392114.js
|
| index ffe5fbb84ce80c0289a5a76c0a7bc1c798383c49..e5cf1cde372f13c72262855b35f4a00390d3b057 100644
|
| --- a/test/mjsunit/regress/regress-frame-details-null-receiver.js
|
| +++ b/test/mjsunit/regress/regress-392114.js
|
| @@ -1,4 +1,4 @@
|
| -// Copyright 2013 the V8 project authors. All rights reserved.
|
| +// Copyright 2014 the V8 project authors. All rights reserved.
|
| // Redistribution and use in source and binary forms, with or without
|
| // modification, are permitted provided that the following conditions are
|
| // met:
|
| @@ -28,24 +28,39 @@
|
| // Flags: --expose-debug-as debug --allow-natives-syntax
|
|
|
| Debug = debug.Debug;
|
| -var listened = false;
|
|
|
| -function listener(event, exec_state, event_data, data) {
|
| - if (event == Debug.DebugEvent.Exception) {
|
| - for (var i = 0; i < exec_state.frameCount(); i++) {
|
| - print(exec_state.frame(i).receiver());
|
| - print(exec_state.frame(i).func().name());
|
| +function dummy(x) {
|
| + return x + 100;
|
| +}
|
| +
|
| +function create_closure() {
|
| + var f = function(arg) {
|
| + if (arg) { %DeoptimizeFunction(f); }
|
| + var a = Array(10);
|
| + for (var i = 0; i < a.length; i++) {
|
| + a[i] = i;
|
| }
|
| }
|
| - listened = true;
|
| + return f;
|
| }
|
|
|
| -Debug.setListener(listener);
|
| -Debug.setBreakOnException();
|
| +var c = create_closure();
|
| +c();
|
| +
|
| +// c CallIC state now has custom Array handler installed.
|
| +
|
| +// Turn on the debugger.
|
| +Debug.setListener(function () {});
|
|
|
| -assertThrows(function() { delete null['foo']; });
|
| +var d = create_closure();
|
| +%OptimizeFunctionOnNextCall(d);
|
| +// Thanks to the debugger, we recreate the full code too. We deopt and run
|
| +// it, stomping on the unexpected AllocationSite in the type vector slot.
|
| +d(true);
|
|
|
| -Debug.clearBreakOnException();
|
| -Debug.setListener(null);
|
| +// CallIC in c misinterprets type vector slot contents as an AllocationSite,
|
| +// corrupting the heap.
|
| +c();
|
|
|
| -assertTrue(listened);
|
| +// CallIC MISS - crash due to corruption.
|
| +dummy();
|
|
|