Module: wine Branch: master Commit: 4d26d30574b2162eabde73140ab0fac18cfb46ff URL: https://gitlab.winehq.org/wine/wine/-/commit/4d26d30574b2162eabde73140ab0fac...
Author: Piotr Caban piotr@codeweavers.com Date: Thu Sep 14 20:47:35 2023 +0200
wineps: Fix EMRPOLYDRAW16 printing.
It fixes EMRPOLYDRAW16 printing when -O2 option is used (in GCC 12.3.1). The compiler assumes that apts table has 0 or 1 elements and optimizes the loop out.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55486
---
dlls/wineps.drv/printproc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index b899814f8c1..74f43b6d27c 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -2738,8 +2738,8 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, if (!pts) return 0; for (i = 0; i < p->cpts; i++) { - pts[i].x = p->apts[i].x; - pts[i].y = p->apts[i].y; + pts[i].x = ((const POINTS *)p->apts)[i].x; + pts[i].y = ((const POINTS *)p->apts)[i].y; } i = poly_draw(data->ctx, pts, (BYTE *)(p->apts + p->cpts), p->cpts) && MoveToEx(data->ctx->hdc, pts[p->cpts - 1].x, pts[p->cpts - 1].y, NULL);