Bug 179619

Summary: Make the jsc shell loadGetterFromGetterSetter() function more robust.
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: fpizlo, jfbastien, keith_miller, msaboff, rmorisset, saam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
proposed patch. saam: review+

Description Mark Lam 2017-11-13 10:49:05 PST
This helps avoid false positives due to abuse of this test function when doing crashes.

<rdar://problem/35492518>
Comment 1 Mark Lam 2017-11-13 11:38:07 PST
Created attachment 326776 [details]
proposed patch.
Comment 2 Saam Barati 2017-11-13 11:42:30 PST
Comment on attachment 326776 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=326776&action=review

> Source/JavaScriptCore/jsc.cpp:3030
> +    if (UNLIKELY(exec->argumentCount() < 1)) {
> +        throwTypeError(exec, scope, ASCIILiteral("Invalid use of loadGetterFromGetterSetter test function: missing argument"));
> +        return encodedJSValue();
> +    }

This is unneeded unless you really care about the error message. This will fall out of the check below.
Comment 3 Mark Lam 2017-11-13 12:06:19 PST
Comment on attachment 326776 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=326776&action=review

Thanks for the review.

>> Source/JavaScriptCore/jsc.cpp:3030
>> +    }
> 
> This is unneeded unless you really care about the error message. This will fall out of the check below.

I will remove this.
Comment 4 Mark Lam 2017-11-13 12:18:40 PST
Landed in r224770: <http://trac.webkit.org/r224770>.