[PATCH v3 0/1] MR8713: widl: Fix crash while replacing type parameters for arrays.
Fixes a crash with parameterized interfaces that have methods containing array argument(s). ``` namespace Test { interface ITest1<T>; [ uuid(006735f5-5f5d-4c39-9106-e1821b4caf04) ] interface ITest1<T> { void Method1([in] int a, [out, retval, size_is(a)]T *v); } declare { interface ITest1<int>; } } ``` widl: ../tools/widl/typegen.c:378: enum typegen_type typegen_detect_type(const type_t *, const attr_list_t *, unsigned int): Assertion `0' failed. -- v3: widl: Fix crash while replacing type parameters for arrays. https://gitlab.winehq.org/wine/wine/-/merge_requests/8713
From: Vibhav Pant <vibhavp(a)gmail.com> --- tools/widl/typetree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/widl/typetree.c b/tools/widl/typetree.c index 3bfb2efeea2..6702d2bb4cf 100644 --- a/tools/widl/typetree.c +++ b/tools/widl/typetree.c @@ -1193,9 +1193,9 @@ static type_t *replace_type_parameters_in_type(type_t *type, typeref_list_t *ori return type; case TYPE_ARRAY: t = replace_type_parameters_in_type(type->details.array.elem.type, orig, repl); - if (t == t->details.array.elem.type) return type; + if (t == type->details.array.elem.type) return type; type = duptype(type, 0); - t->details.array.elem.type = t; + type->details.array.elem.type = t; return type; case TYPE_FUNCTION: t = duptype(type, 0); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/8713
On Wed Aug 6 10:09:34 2025 +0000, Vibhav Pant wrote:
changed this line in [version 3 of the diff](/wine/wine/-/merge_requests/8713/diffs?diff_id=198537&start_sha=715ce7449753a785a17657884fd623466f8ecc2f#06f6f5e1d8c837fb483c79004647ce3f2d069910_1196_1196) Ah right, thanks for catching this!
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/8713#note_112199
This merge request was approved by Rémi Bernon. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8713
participants (3)
-
Rémi Bernon -
Vibhav Pant -
Vibhav Pant (@vibhavp)