WebKit Bugzilla
Attachment 370365 Details for
Bug 198096
: WHLSL: Parsing negative int literals parses the positive value instead
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
c-backup.diff (text/plain), 2.12 KB, created by
Saam Barati
on 2019-05-21 18:25:18 PDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Saam Barati
Created:
2019-05-21 18:25:18 PDT
Size:
2.12 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 245608) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,18 @@ >+2019-05-21 Saam barati <sbarati@apple.com> >+ >+ WHLSL: Parsing negative int literals parses the positive value instead >+ https://bugs.webkit.org/show_bug.cgi?id=198096 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ I also made the code around < INT_MIN a bit easier to follow along with. >+ >+ No new tests because we haven't imported WHLSL test suite yet. >+ Verified this works using the AST dumper. >+ >+ * Modules/webgpu/WHLSL/WHLSLParser.cpp: >+ (WebCore::WHLSL::intLiteralToInt): >+ > 2019-05-21 Myles C. Maxfield <mmaxfield@apple.com> > > font-optical-sizing applies the wrong variation value >Index: Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.cpp >=================================================================== >--- Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.cpp (revision 245608) >+++ Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.cpp (working copy) >@@ -230,10 +230,10 @@ static Expected<int, Parser::Error> intL > return Unexpected<Parser::Error>(Parser::Error(makeString("int literal ", text, " is out of bounds"))); > } > if (negate) { >- static_assert(std::numeric_limits<long long int>::min() < std::numeric_limits<int>::min(), "long long needs to be bigger than an int"); >- if (static_cast<long long>(result) > std::abs(static_cast<long long>(std::numeric_limits<int>::min()))) >+ int64_t intResult = -static_cast<int64_t>(result); >+ if (intResult < static_cast<int64_t>(std::numeric_limits<int>::min())) > return Unexpected<Parser::Error>(Parser::Error(makeString("int literal ", text, " is out of bounds"))); >- return { static_cast<int>(static_cast<long long>(result) * 1) }; >+ return { static_cast<int>(intResult) }; > } > if (result > static_cast<unsigned>(std::numeric_limits<int>::max())) > return Unexpected<Parser::Error>(Parser::Error(makeString("int literal ", text, " is out of bounds")));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dino
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198096
:
370365
|
370372