m_typeMap is currently HashMap<AST::Expression*, ResolvingType> m_typeMap; This is buggy, because some code in the checker has references into it, and they get invalidated whenever the typeMap is resized. Instead the Map should contain UniqueRef<ResolvingType>, and then we should only have references to the ResolvingType itself. This bugs currently prevents checking the full standard library.
Created attachment 370812 [details] WIP
Comment on attachment 370812 [details] WIP View in context: https://bugs.webkit.org/attachment.cgi?id=370812&action=review > Source/WebCore/Modules/webgpu/WHLSL/WHLSLChecker.cpp:494 > + HashMap<AST::Expression*, std::unique_ptr<ResolvingType>> m_typeMap; UniqueRef didn't work?
No, because it does not offer the right methods to be in a HashMap (I think it is missing a copy operator or something. I could have looked in detail, and tried to improve either HashMap or UniqueRef to work together, but using std::unique_ptr seemed way easier and good enough for this purpose. (In reply to Myles C. Maxfield from comment #2) > Comment on attachment 370812 [details] > WIP > > View in context: > https://bugs.webkit.org/attachment.cgi?id=370812&action=review > > > Source/WebCore/Modules/webgpu/WHLSL/WHLSLChecker.cpp:494 > > + HashMap<AST::Expression*, std::unique_ptr<ResolvingType>> m_typeMap; > > UniqueRef didn't work?
<rdar://problem/51288768>
patch forthcoming with tests.
actually, just gonna do this as part of the matrix patch. it's too difficult to split up as we'll end up with checker errors.
*** This bug has been marked as a duplicate of bug 198876 ***