diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 4cc6660b..a96e70e9 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -6281,6 +6281,7 @@ if test "$enable_widl_SLTG_Typelib_Support" -eq 1; then patch_apply widl-SLTG_Typelib_Support/0018-widl-Fix-generation-of-resources-containing-an-old-t.patch patch_apply widl-SLTG_Typelib_Support/0019-widl-Add-oldtlb-switch-in-usage-message.patch patch_apply widl-SLTG_Typelib_Support/0020-stdole32.tlb-Compile-typelib-with-oldtlb.patch + patch_apply widl-SLTG_Typelib_Support/0021-widl-Avoid-relying-on-side-effects-when-marking-func.patch ( echo '+ { "Dmitry Timoshkov", "widl: Add initial implementation of SLTG typelib generator.", 1 },'; echo '+ { "Dmitry Timoshkov", "widl: Add support for structures.", 1 },'; @@ -6302,6 +6303,7 @@ if test "$enable_widl_SLTG_Typelib_Support" -eq 1; then echo '+ { "Dmitry Timoshkov", "widl: Fix generation of resources containing an old typelib.", 1 },'; echo '+ { "Sebastian Lackner", "widl: Add --oldtlb switch in usage message.", 1 },'; echo '+ { "Sebastian Lackner", "stdole32.tlb: Compile typelib with --oldtlb.", 1 },'; + echo '+ { "Dmitry Timoshkov", "widl: Avoid relying on side effects when marking function index as the last one.", 1 },'; ) >> "$patchlist" fi diff --git a/patches/widl-SLTG_Typelib_Support/0021-widl-Avoid-relying-on-side-effects-when-marking-func.patch b/patches/widl-SLTG_Typelib_Support/0021-widl-Avoid-relying-on-side-effects-when-marking-func.patch new file mode 100644 index 00000000..6c07fc2c --- /dev/null +++ b/patches/widl-SLTG_Typelib_Support/0021-widl-Avoid-relying-on-side-effects-when-marking-func.patch @@ -0,0 +1,33 @@ +From 2404f4a367d658dc2b54f89381e6038a1bb68660 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Fri, 22 Jan 2016 11:52:22 +0800 +Subject: widl: Avoid relying on side effects when marking function index as + the last one. + +--- + tools/widl/write_sltg.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/tools/widl/write_sltg.c b/tools/widl/write_sltg.c +index bf2ba5f..acfc039 100644 +--- a/tools/widl/write_sltg.c ++++ b/tools/widl/write_sltg.c +@@ -1465,11 +1465,12 @@ static void add_interface_typeinfo(struct sltg_typelib *typelib, type_t *iface) + + STATEMENTS_FOR_EACH_FUNC(stmt_func, type_iface_get_stmts(iface)) + { +- if (i == func_count - 1) i |= 0x80000000; ++ int idx = inherited_func_count + i; ++ ++ if (i == func_count - 1) idx |= 0x80000000; + + base_offset += add_func_desc(typelib, &data, stmt_func->u.var, +- inherited_func_count + i, +- dispid++, base_offset, &hrefmap); ++ idx, dispid + i, base_offset, &hrefmap); + i++; + } + +-- +2.6.4 +