Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d552f3bf1512e47a070057df999049e537cd8350
https://github.com/WebKit/WebKit/commit/d552f3bf1512e47a070057df999049e537cd8350
Author: Tadeu Zagallo <[email protected]>
Date: 2023-06-19 (Mon, 19 Jun 2023)
Changed paths:
M Source/WebGPU/WGSL/TypeCheck.cpp
M Source/WebGPU/WGSL/tests/invalid/function-call.wgsl
Log Message:
-----------
[WGSL] Type checker crashes when calling a non-existing function
https://bugs.webkit.org/show_bug.cgi?id=258280
rdar://111003956
Reviewed by Dan Glastonbury.
When type checking a call we try to identify what is the type bound to the
target,
e.g. for `f()`, first we look up the typing context to see if there's a type or
value bound to `f`. If there is none, we try to look up overloaded declarations
for `f`. If `f` isn't overloaded either, we have to emit an error, but at this
point we were unconditionally using the binding to construct the error message
(the first lookup just mentioned), which will be null if `f` doesn't exist. To
fix that we check if the binding exists to decide which error message we should
emit: either that the target doesn't exist or that it's an invalid target for a
call (i.e. it exists, but isn't a function).
* Source/WebGPU/WGSL/TypeCheck.cpp:
(WGSL::TypeChecker::visit):
* Source/WebGPU/WGSL/tests/invalid/function-call.wgsl:
Canonical link: https://commits.webkit.org/265312@main
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes