Bug 157084 - Assertion failure for exception in "prototype" property getter and Reflect.construct
Summary: Assertion failure for exception in "prototype" property getter and Reflect.co...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-27 10:29 PDT by André Bargull
Modified: 2016-04-29 13:01 PDT (History)
7 users (show)

See Also:


Attachments
Patch (3.46 KB, patch)
2016-04-29 11:59 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description André Bargull 2016-04-27 10:29:27 PDT
SVN: rev200124
Build with: perl Tools/Scripts/build-jsc --gtk --debug


The following test case triggers this assertion error:
---
ASSERTION FAILED: !exec->hadException()
---


Test case:
---
var bf = (function(){}).bind(); Object.defineProperty(bf, "prototype", { get() { throw Error() } }); Reflect.construct(Array, [], bf)
---


Stack trace:
---
#0  0x00007ffff6e289ac in WTFCrash () at ../../Source/WTF/wtf/Assertions.cpp:322
#1  0x00007ffff6bbf1cb in JSC::InternalFunction::createSubclassStructure (exec=0x7fffffffc800, newTarget=..., baseClass=0x7fffaedf4380) at ../../Source/JavaScriptCore/runtime/InternalFunction.cpp:113
#2  0x0000000000447887 in JSC::JSGlobalObject::arrayStructureForIndexingTypeDuringAllocation (this=0x7fffaede7900, exec=0x7fffffffc800, indexingType=3 '\003', newTarget=...)
    at ../../Source/JavaScriptCore/runtime/JSGlobalObject.h:506
#3  0x00000000004478c5 in JSC::JSGlobalObject::arrayStructureForProfileDuringAllocation (this=0x7fffaede7900, exec=0x7fffffffc800, profile=0x0, newTarget=...)
    at ../../Source/JavaScriptCore/runtime/JSGlobalObject.h:510
#4  0x00007ffff600afb9 in JSC::constructArray (exec=0x7fffffffc800, profile=0x0, globalObject=0x7fffaede7900, values=..., newTarget=...) at ../../Source/JavaScriptCore/runtime/JSGlobalObject.h:766
#5  0x00007ffff6b2efd6 in JSC::constructArrayWithSizeQuirk (exec=0x7fffffffc800, args=..., newTarget=...) at ../../Source/JavaScriptCore/runtime/ArrayConstructor.cpp:101
#6  0x00007ffff6b2f03c in JSC::constructWithArrayConstructor (exec=0x7fffffffc800) at ../../Source/JavaScriptCore/runtime/ArrayConstructor.cpp:107
#7  0x00007ffff6a2da0a in vmEntryToNative () at ../../Source/JavaScriptCore/runtime/Butterfly.h:58
#8  0x00007ffff6998ae5 in JSC::Interpreter::executeConstruct (this=0x7ffff0def058, callFrame=0x7fffffffcae0, constructor=0x7fffaedbbe00, constructType=<incomplete type>, constructData=..., args=..., 
    newTarget=...) at ../../Source/JavaScriptCore/interpreter/Interpreter.cpp:1090
#9  0x00007ffff6b8a3ac in JSC::construct (exec=0x7fffffffcae0, constructorObject=..., constructType=<incomplete type>, constructData=..., args=..., newTarget=...)
    at ../../Source/JavaScriptCore/runtime/ConstructData.cpp:52
#10 0x00007ffff6cfbbd8 in JSC::reflectObjectConstruct (exec=0x7fffffffcae0) at ../../Source/JavaScriptCore/runtime/ReflectObject.cpp:130
#11 0x00007fffb0bff028 in ?? ()
#12 0x00007fffffffcb60 in ?? ()
#13 0x00007ffff6a33818 in llint_entry () at ../../Source/JavaScriptCore/runtime/Butterfly.h:58
---
Comment 1 Yusuke Suzuki 2016-04-29 11:17:40 PDT
As of r196966, createSubclassStructure is allowed to throw any exceptions.
So, let's drop this assertion and return if there is some exceptions.

http://trac.webkit.org/changeset/196966
Comment 2 Yusuke Suzuki 2016-04-29 11:59:30 PDT
Created attachment 277724 [details]
Patch
Comment 3 Mark Lam 2016-04-29 12:07:32 PDT
Comment on attachment 277724 [details]
Patch

r=me
Comment 4 Yusuke Suzuki 2016-04-29 12:11:49 PDT
Comment on attachment 277724 [details]
Patch

Thanks!
Comment 5 WebKit Commit Bot 2016-04-29 13:01:11 PDT
Comment on attachment 277724 [details]
Patch

Clearing flags on attachment: 277724

Committed r200257: <http://trac.webkit.org/changeset/200257>
Comment 6 WebKit Commit Bot 2016-04-29 13:01:16 PDT
All reviewed patches have been landed.  Closing bug.