Bug 157081

Summary: Assertion failure for bound function with custom prototype and Reflect.construct
Product: WebKit Reporter: André Bargull <andre.bargull>
Component: JavaScriptCoreAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, ggaren, keith_miller, mark.lam, msaboff, saam, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 175191    
Attachments:
Description Flags
Patch none

André Bargull
Reported 2016-04-27 10:28:38 PDT
SVN: rev200124 Build with: perl Tools/Scripts/build-jsc --gtk --debug The following test case triggers this assertion error: --- ASSERTION FAILED: prototype != baseStructure->storedPrototype() --- Test case: --- Reflect.construct(Array, [], Object.defineProperty(function(){}.bind(), "prototype", {value: Array.prototype})); --- Stack trace: --- #0 0x00007ffff6e289ac in WTFCrash () at ../../Source/WTF/wtf/Assertions.cpp:322 #1 0x00007ffff6bbf328 in JSC::InternalFunctionAllocationProfile::createAllocationStructureFromBase (this=0x7fffaedb3ea0, vm=..., owner=0x7fffaedb3e80, prototype=0x7fffaedd36a0, baseStructure=0x7fffaedf4380) at ../../Source/JavaScriptCore/bytecode/InternalFunctionAllocationProfile.h:50 #2 0x00007ffff6bbf443 in JSC::FunctionRareData::createInternalFunctionAllocationStructureFromBase (this=0x7fffaedb3e80, vm=..., prototype=0x7fffaedd36a0, baseStructure=0x7fffaedf4380) at ../../Source/JavaScriptCore/runtime/FunctionRareData.h:90 #3 0x00007ffff6bbf200 in JSC::InternalFunction::createSubclassStructure (exec=0x7fffffffc800, newTarget=..., baseClass=0x7fffaedf4380) at ../../Source/JavaScriptCore/runtime/InternalFunction.cpp:115 #4 0x0000000000447887 in JSC::JSGlobalObject::arrayStructureForIndexingTypeDuringAllocation (this=0x7fffaede7900, exec=0x7fffffffc800, indexingType=3 '\003', newTarget=...) at ../../Source/JavaScriptCore/runtime/JSGlobalObject.h:506 #5 0x00000000004478c5 in JSC::JSGlobalObject::arrayStructureForProfileDuringAllocation (this=0x7fffaede7900, exec=0x7fffffffc800, profile=0x0, newTarget=...) at ../../Source/JavaScriptCore/runtime/JSGlobalObject.h:510 #6 0x00007ffff600afb9 in JSC::constructArray (exec=0x7fffffffc800, profile=0x0, globalObject=0x7fffaede7900, values=..., newTarget=...) at ../../Source/JavaScriptCore/runtime/JSGlobalObject.h:766 #7 0x00007ffff6b2efd6 in JSC::constructArrayWithSizeQuirk (exec=0x7fffffffc800, args=..., newTarget=...) at ../../Source/JavaScriptCore/runtime/ArrayConstructor.cpp:101 #8 0x00007ffff6b2f03c in JSC::constructWithArrayConstructor (exec=0x7fffffffc800) at ../../Source/JavaScriptCore/runtime/ArrayConstructor.cpp:107 #9 0x00007ffff6a2da0a in vmEntryToNative () at ../../Source/JavaScriptCore/runtime/Butterfly.h:58 #10 0x00007ffff6998ae5 in JSC::Interpreter::executeConstruct (this=0x7ffff0def058, callFrame=0x7fffffffcae0, constructor=0x7fffaedbbe00, constructType=<incomplete type>, constructData=..., args=..., newTarget=...) at ../../Source/JavaScriptCore/interpreter/Interpreter.cpp:1090 #11 0x00007ffff6b8a3ac in JSC::construct (exec=0x7fffffffcae0, constructorObject=..., constructType=<incomplete type>, constructData=..., args=..., newTarget=...) at ../../Source/JavaScriptCore/runtime/ConstructData.cpp:52 #12 0x00007ffff6cfbbd8 in JSC::reflectObjectConstruct (exec=0x7fffffffcae0) at ../../Source/JavaScriptCore/runtime/ReflectObject.cpp:130 #13 0x00007fffb0bff028 in ?? () #14 0x00007fffffffcb60 in ?? () #15 0x00007ffff6a33818 in llint_entry () at ../../Source/JavaScriptCore/runtime/Butterfly.h:58 Backtrace stopped: frame did not save the PC ---
Attachments
Patch (3.19 KB, patch)
2016-04-30 07:35 PDT, Yusuke Suzuki
no flags
Radar WebKit Bug Importer
Comment 1 2016-04-29 12:12:50 PDT
Yusuke Suzuki
Comment 2 2016-04-29 12:13:08 PDT
This assertion is incorrect. We ensured newTarget != exec->callee(). But it does not guarantee that newTarget.[[Prototype]] != exec->callee().[[Prototype]].
Yusuke Suzuki
Comment 3 2016-04-30 07:35:02 PDT
Saam Barati
Comment 4 2016-05-01 16:03:03 PDT
Comment on attachment 277807 [details] Patch r=me
WebKit Commit Bot
Comment 5 2016-05-02 01:08:48 PDT
Comment on attachment 277807 [details] Patch Clearing flags on attachment: 277807 Committed r200319: <http://trac.webkit.org/changeset/200319>
WebKit Commit Bot
Comment 6 2016-05-02 01:08:52 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.