[webkit-reviews] review granted: [Bug 202312] operationSwitchCharWithUnknownKeyType failed to handle OOME when resolving rope string. : [Attachment 381034] propose patch.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 15 15:49:53 PDT 2019


Yusuke Suzuki <ysuzuki at apple.com> has granted Mark Lam <mark.lam at apple.com>'s
request for review:
Bug 202312: operationSwitchCharWithUnknownKeyType failed to handle OOME when
resolving rope string.
https://bugs.webkit.org/show_bug.cgi?id=202312

Attachment 381034: propose patch.

https://bugs.webkit.org/attachment.cgi?id=381034&action=review




--- Comment #7 from Yusuke Suzuki <ysuzuki at apple.com> ---
Comment on attachment 381034
  --> https://bugs.webkit.org/attachment.cgi?id=381034
propose patch.

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

r=me with nit.

> Source/JavaScriptCore/jit/JITOperations.cpp:2316
> +	       StringImpl* value = string->value(exec).impl();

I suggest doing

String value = string->value(exec);
RETURN_IF_EXCEPTION(throwScope, nullptr);
Use value[0] Or  value.impl()[0]

To make sure that string is live (I think this case is OK, but it is still
better I think).


More information about the webkit-reviews mailing list