diff --git a/src/snapshot/code-serializer.cc b/src/snapshot/code-serializer.cc index 86a91643d2..511f111752 100644 --- a/src/snapshot/code-serializer.cc +++ b/src/snapshot/code-serializer.cc @@ -104,6 +104,12 @@ void CodeSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code, return SerializeObject(isolate()->heap()->undefined_value(), how_to_code, where_to_point, skip); } + + if (obj->IsScript()) { + // Wrapper object is a context-dependent JSValue. Reset it here. + Script::cast(obj)->set_wrapper(isolate()->heap()->undefined_value()); + } + // Past this point we should not see any (context-specific) maps anymore. CHECK(!obj->IsMap()); // There should be no references to the global object embedded. diff --git a/test/mjsunit/regress/wasm/regression-674447.js b/test/mjsunit/regress/wasm/regression-674447.js new file mode 100644 index 0000000000..228b038334 --- /dev/null +++ b/test/mjsunit/regress/wasm/regression-674447.js @@ -0,0 +1,10 @@ +// Copyright 2016 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Flags: --validate-asm --cache=code + +(function() { + "use asm"; + return function f() {} +})();