Changeset 245662 in webkit
- Timestamp:
- May 22, 2019, 5:33:45 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/webgpu/whlsl-dont-crash-parsing-enum-expected.html (added)
-
LayoutTests/webgpu/whlsl-dont-crash-parsing-enum.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h (modified) (1 diff)
-
Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h (modified) (1 diff)
-
Source/WebCore/Modules/webgpu/WHLSL/WHLSLASTDumper.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r245661 r245662 1 2019-05-22 Saam barati <sbarati@apple.com> 2 3 WHLSL: fix enum parsing 4 https://bugs.webkit.org/show_bug.cgi?id=198087 5 6 Reviewed by Myles Maxfield. 7 8 * webgpu/whlsl-dont-crash-parsing-enum-expected.html: Added. 9 * webgpu/whlsl-dont-crash-parsing-enum.html: Added. 10 1 11 2019-05-22 Ryosuke Niwa <rniwa@webkit.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r245656 r245662 1 2019-05-22 Saam barati <sbarati@apple.com> 2 3 WHLSL: fix enum parsing 4 https://bugs.webkit.org/show_bug.cgi?id=198087 5 6 Reviewed by Myles Maxfield. 7 8 This fixes two bugs: 9 10 1. We were using a String by reference after moving the underlying owner of 11 the string. This would lead to the String becoming the empty value, and 12 crashing when used as a key in a hash map. 13 2. We were incorrectly producing a syntax error for enum declarations by 14 saying it's invalid if an enum value was added to a hash map for the first 15 time. This logic should be negated. We need to error when it's added for 16 the second time and onwards. 17 18 Test: webgpu/whlsl-dont-crash-parsing-enum.html 19 20 * Modules/webgpu/WHLSL/AST/WHLSLAST.h: Replaced. 21 * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h: 22 (WebCore::WHLSL::AST::EnumerationDefinition::add): 23 * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h: 24 (WebCore::WHLSL::AST::EnumerationMember::name): 25 * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp: Replaced. 26 (WebCore::WHLSL::ASTDumper::visit): 27 * Modules/webgpu/WHLSL/WHLSLASTDumper.h: Replaced. 28 1 29 2019-05-22 Simon Fraser <simon.fraser@apple.com> 2 30 -
trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h
r239930 r245662 65 65 { 66 66 auto result = m_members.add(member.name(), std::make_unique<EnumerationMember>(WTFMove(member))); 67 return !result.isNewEntry;67 return result.isNewEntry; 68 68 } 69 69 -
trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h
r239844 r245662 56 56 57 57 const Lexer::Token& origin() const { return m_origin; } 58 String &name() { return m_name; }58 String name() { return m_name; } 59 59 Optional<ConstantExpression>& value() { return m_value; } 60 60 -
trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLASTDumper.cpp
r245613 r245662 112 112 void ASTDumper::visit(AST::EnumerationDefinition& enumerationDefinition) 113 113 { 114 // FIXME: Test this once we parse enums: 115 // https://bugs.webkit.org/show_bug.cgi?id=198087 116 117 m_out.println(m_indent, "enum "); 114 m_out.print(m_indent, "enum "); 118 115 visit(enumerationDefinition.type()); 119 116 m_out.print(" {"); … … 340 337 } 341 338 342 void ASTDumper::visit(AST::EnumerationMemberLiteral&) 343 { 344 // FIXME: Handle this when we can parse enums: 345 // https://bugs.webkit.org/show_bug.cgi?id=198087 339 void ASTDumper::visit(AST::EnumerationMemberLiteral& enumerationMemberLiteral) 340 { 341 m_out.print(enumerationMemberLiteral.left(), ".", enumerationMemberLiteral.right()); 346 342 } 347 343
Note:
See TracChangeset
for help on using the changeset viewer.