<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>141187</bug_id>
          
          <creation_ts>2015-02-02 19:57:27 -0800</creation_ts>
          <short_desc>Crash in JSC::createTypeError</short_desc>
          <delta_ts>2016-02-02 15:53:12 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Han Choongwoo">cwhan.tunz</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ddkilzer</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1066335</commentid>
    <comment_count>0</comment_count>
    <who name="Han Choongwoo">cwhan.tunz</who>
    <bug_when>2015-02-02 19:57:27 -0800</bug_when>
    <thetext>this code crashes.
----
new
function f() {
for (f in [1])({})();
}
----

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7ae324f in JSC::createTypeError(JSC::JSGlobalObject*, WTF::String const&amp;) ()
   from /development/tunz/javascript/webkit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
(gdb) bt
#0  0x00007ffff7ae324f in JSC::createTypeError(JSC::JSGlobalObject*, WTF::String const&amp;) ()
   from /development/tunz/javascript/webkit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#1  0x00007ffff7aea152 in JSC::createError(JSC::ExecState*, JSC::JSObject* (*)(JSC::ExecState*, WTF::String const&amp;), JSC::JSValue, WTF::String const&amp;) ()
   from /development/tunz/javascript/webkit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#2  0x00007ffff7aeaa27 in JSC::createNotAFunctionError(JSC::ExecState*, JSC::JSValue) ()
   from /development/tunz/javascript/webkit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#3  0x00007ffff7bf7f8d in JSC::LLInt::handleHostCall(JSC::ExecState*, JSC::Instruction*, JSC::JSValue, JSC::CodeSpecializationKind) [clone .isra.113] ()
   from /development/tunz/javascript/webkit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#4  0x00007ffff7bff460 in llint_slow_path_call ()
   from /development/tunz/javascript/webkit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#5  0x00007ffff7c09fdd in llint_entry ()
   from /development/tunz/javascript/webkit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#6  0x00007ffff7c0a0e8 in llint_entry ()
   from /development/tunz/javascript/webkit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#7  0x00007ffff7c046c9 in vmEntryToJavaScript ()
   from /development/tunz/javascript/webkit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#8  0x00007ffff7998854 in JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) ()
   from /development/tunz/javascript/webkit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#9  0x00007ffff797b47d in JSC::Interpreter::execute(JSC::ProgramExecutable*, JSC::ExecState*, JSC::JSObject*) ()
   from /development/tunz/javascript/webkit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#10 0x00007ffff7ad062a in JSC::evaluate(JSC::ExecState*, JSC::SourceCode const&amp;, JSC::JSValue, JSC::JSValue*) ()
   from /development/tunz/javascript/webkit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#11 0x000000000040c489 in jscmain(int, char**) ()
#12 0x0000000000406da8 in main ()

ASSERTION FAILED: cell-&gt;isObject()
/development/tunz/javascript/webkit/Source/JavaScriptCore/runtime/JSObject.h(1190) : JSC::JSObject* JSC::asObject(JSC::JSCell*)
1   0x7fe551c86394 /development/tunz/javascript/webkit/WebKitDebug/Debug/lib/libjavascriptcoregtk-4.0.so.18(WTFCrash+0x1e) [0x7fe551c86394]
2   0x42f983 ../jsc_d(_ZN3JSC8asObjectEPNS_6JSCellE+0x3d) [0x42f983]
3   0x42f9b1 ../jsc_d(_ZN3JSC8asObjectENS_7JSValueE+0x20) [0x42f9b1]
4   0x43014f ../jsc_d(_ZNK3JSC8Register8functionEv+0x4d) [0x43014f]
5   0x42c700 ../jsc_d(_ZNK3JSC9ExecState6calleeEv+0x1c) [0x42c700]
6   0x4311f6 ../jsc_d(_ZNK3JSC9ExecState2vmEv+0x18) [0x4311f6]
7   0x7fe551ad9dae /development/tunz/javascript/webkit/WebKitDebug/Debug/lib/libjavascriptcoregtk-4.0.so.18(+0x1262dae) [0x7fe551ad9dae]
8   0x7fe551c37c49 /development/tunz/javascript/webkit/WebKitDebug/Debug/lib/libjavascriptcoregtk-4.0.so.18(+0x13c0c49) [0x7fe551c37c49]
Segmentation fault

Also, 
----
new
function f() {
for (f in [1]);
print(f);
}
----

Output of above code should be 
----
function f() {
for (f in [1]);
print(f);
}
----

But, in JSC, output is 0.

found with afl-fuzz.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1161445</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2016-02-02 15:53:12 -0800</bug_when>
    <thetext>&lt;rdar://problem/24469697&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>