WebKit Bugzilla
Attachment 371465 Details for
Bug 198306
: [WHLSL] The name resolver does not deal with nativeFunctionDeclaration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
patch198306 (text/plain), 2.81 KB, created by
Robin Morisset
on 2019-06-05 19:01:44 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Robin Morisset
Created:
2019-06-05 19:01:44 PDT
Size:
2.81 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 5bdb885c495..ef794701407 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2019-06-05 Robin Morisset <rmorisset@apple.com> >+ >+ [WHLSL] The name resolver does not deal with nativeFunctionDeclaration >+ https://bugs.webkit.org/show_bug.cgi?id=198306 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ We currently have a crash in the nameResolver when trying to use the full standard library. >+ What is happening is that because we don't specify anything to do to nativeFunctionDeclarations, names in their parameters >+ are added to the global environment. And so as soon as we have two such parameters with the same name, the name resolver fails. >+ >+ * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp: >+ (WebCore::WHLSL::NameResolver::visit): >+ * Modules/webgpu/WHLSL/WHLSLNameResolver.h: >+ > 2019-06-05 Robin Morisset <rmorisset@apple.com> > > [WHLSL] Parsing and lexing the standard library is slow >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLNameResolver.cpp b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLNameResolver.cpp >index 21ca18dcfa3..c8004290ded 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLNameResolver.cpp >+++ b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLNameResolver.cpp >@@ -94,6 +94,16 @@ void NameResolver::visit(AST::FunctionDefinition& functionDefinition) > newNameResolver.checkErrorAndVisit(functionDefinition.block()); > } > >+void NameResolver::visit(AST::NativeFunctionDeclaration& nativeFunctionDeclaration) >+{ >+ NameContext newNameContext(&m_nameContext); >+ NameResolver newNameResolver(newNameContext); >+ newNameResolver.setCurrentFunctionDefinition(m_currentFunction); >+ checkErrorAndVisit(nativeFunctionDeclaration.type()); >+ for (auto& parameter : nativeFunctionDeclaration.parameters()) >+ newNameResolver.checkErrorAndVisit(parameter); >+} >+ > void NameResolver::visit(AST::Block& block) > { > NameContext nameContext(&m_nameContext); >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLNameResolver.h b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLNameResolver.h >index 8fb4a34fbd4..89f08669075 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLNameResolver.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLNameResolver.h >@@ -43,14 +43,14 @@ public: > > virtual ~NameResolver() = default; > >- void visit(AST::FunctionDefinition&) override; >- > void setCurrentFunctionDefinition(AST::FunctionDefinition* functionDefinition) > { > m_currentFunction = functionDefinition; > } > > private: >+ void visit(AST::FunctionDefinition&) override; >+ void visit(AST::NativeFunctionDeclaration&) override; > void visit(AST::TypeReference&) override; > void visit(AST::Block&) override; > void visit(AST::IfStatement&) override;
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:
mmaxfield
:
review-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198306
:
371465
|
371769