From nobody Sun Apr 12 07:20:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1771075126; cv=none; d=zohomail.com; s=zohoarc; b=KQHmiFKuoA2MxpVldBl80NrLxBrIQ872K5CN9l1Td8qTFT5Zq2/PjsthNfyVEpyJJf0zc5exB8BC1cOaRsR8L5wsNdtU5Lnfyl5J11iaD9HRsufZCEDSwUQL2FiNL8vPCefDx4+EVH+tLtJOxEk7Sr6KIOHg50VjX74AM4l9HWo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771075126; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fNoZb4bp9DmDOYZJ/ogzsqn+KnRGtybuYeAcnSj4TvA=; b=k7yAlkNyTXiwDUG1Yb78HPsZ2XDqrifU9hAJ0T46yrYow+tHL+3nH6Oy98x2yScPJ+WL8YpOZCb/RbNK06PKG1vURIsI9qTsKCMW2Wwhd6m7uJBqX2C2d+BOkoTdMI5S5th4+8BU/UGvuWQst8UqU3tOj8PAAfKoe4FbJBnWv08= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771075126070588.3542112978728; Sat, 14 Feb 2026 05:18:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vrFWy-0005fH-IU; Sat, 14 Feb 2026 08:17:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vrFWV-0005Tg-LO for qemu-devel@nongnu.org; Sat, 14 Feb 2026 08:17:26 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vrFWS-0007uc-TD for qemu-devel@nongnu.org; Sat, 14 Feb 2026 08:17:23 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4836f363ad2so19516545e9.1 for ; Sat, 14 Feb 2026 05:17:20 -0800 (PST) Received: from archlinux (dynamic-092-224-176-164.92.224.pool.telefonica.de. [92.224.176.164]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43796ac800esm13340471f8f.27.2026.02.14.05.17.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Feb 2026 05:17:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771075039; x=1771679839; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fNoZb4bp9DmDOYZJ/ogzsqn+KnRGtybuYeAcnSj4TvA=; b=QTQMRFV25fwdy2wlplrB5rWLdUO+s26wywb6ApTiDlPkgqs8yORGKf5csHCViza5tC vqmFHbhFP6Tp+yL+9a+oNHkLwcDqVpXIkGBQgQ4LI5Js6GhPp4/7YIQpe0ZRlGhkTsn8 +ZEjRhsKsHEc1IHNFUfg1+Xmj2psleiH1mSbXMMVnHJkC7O0besWz081ILKwpfqqlqAJ 8SqJgsl4PCAMI8FBtYr8gFaHdAUSmBvB3tfcECH8GORQqMN9awdHh64gaY+UKWfWkeIx +n699rkWgGBdM1usqQiQkuVQzk/EI9/rMnJzEs5g535P3et7kbFvoz5BYUaDplUpOL8l o5YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771075039; x=1771679839; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=fNoZb4bp9DmDOYZJ/ogzsqn+KnRGtybuYeAcnSj4TvA=; b=CwdvbaY9Yd3IMxY6bhmDtbBvVxdhkp11d2pbr0AsnmPfN/wAgOl4VaJpvNg/miusbw IK56A1/wcBdaUa4EVBpYbK8a69N3gGfuPO2GF8MXGXX+ly5lI9SYLSmwBQ/mxYPL6Nz0 slxUTEFWpV7cbwb2NReWqb8obYK2NxTA8KHAHYn49h8o4qsJDEOdMpMknxtBlQ9hBC8O 1cUbU9HGfy02eQNgkgQ8jH7EzuqS2JubAFuBAqwNzYFHMChLAnPubttkrOp8ZOy34XwD GuhDlm4WJfPQri0utrstUiJW4DBulT9lYRx+8Vp+uKMEUQumFxv+Ha4+YmvSyP2L3WWE swnw== X-Gm-Message-State: AOJu0Yy0y2ytOrYxq6V5X8d6barVfI3VzzXTUegiG0008yADFJBFE087 Zghl622L0WAPJUs14005d0KJxiBs8LWp6dAcHXc4tmJE6rFYaVpBON2zSOGcLw== X-Gm-Gg: AZuq6aKIM9kvKTOA7cKR9cERpZYUnMwpUx8IquOcnsAfPK9SFzYic9EoFhS4IL6fXdv 7pohsCYfQmlhazAu+YyEyeIxEveuynq6VDUdmIq+YRBld895rkbazAsWmGzxXpgzNDfjhqaJVqs RS0A+AS6tTUw/M/f/nnyZVl6n1p759n0YFdtL2KtdQFaBv3eyxxw97bJDCLjhB3Cz/KD7hia1U7 POqof/eb9vu8HE7fsNKq9UT+PK0maeNTykIROoceACK33U5U2H29BQ8p8U0u/5qFzDHgUxO7gPA 0JOM4ZeSSH2tfM3Rxdz39oll7HBeBN2ii2cIDRuoQWQUhz3JSdY9wJrEUqbvu73jc2AB1Zm7+Ji C47lo0wxh/id8pcxtWCDTLhrUkJqEzbyHBhXpyhZlYtF9diCMmAEjd9Lx6Ye7P8LNawyhr7xFXy xqfN5csnPE9cwpti1Zb83qUBXdViru6WBrehOw1JUcOXjya2QaftyAXXxXYxLJjSL1OsVHIicSK ZRnbBTR1vxUyaVo X-Received: by 2002:a05:600c:190c:b0:477:5af7:6fa with SMTP id 5b1f17b1804b1-48373a59a74mr70610875e9.32.1771075038598; Sat, 14 Feb 2026 05:17:18 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Cameron Esfahani , Magnus Kulke , Roman Bolshakov , Phil Dennis-Jordan , Wei Liu , Mohamed Mediouni , Bernhard Beschow Subject: [PATCH 1/3] target/i386/emulate/x86_decode: Fix compiler warning Date: Sat, 14 Feb 2026 14:16:57 +0100 Message-ID: <20260214131659.31378-2-shentey@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260214131659.31378-1-shentey@gmail.com> References: <20260214131659.31378-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=shentey@gmail.com; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1771075128821154100 Content-Type: text/plain; charset="utf-8" When compiling for i386-softmmu under MSYS2, GCC emits the following warnin= g: In function 'get_reg_val', inlined from 'calc_modrm_operand64' at ../src/target/i386/emulate/x86= _decode.c:1796:15: ../src/target/i386/emulate/x86_decode.c:1703:5: error: 'memcpy' forming o= ffset [4, 7] is out of the bounds [0, 4] of object 'val' with type 'target_= ulong' {aka 'unsigned int'} [-Werror=3Darray-bounds=3D] 1703 | memcpy(&val, | ^~~~~~~~~~~~ 1704 | get_reg_ref(env, reg, rex_present, is_extended, size), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1705 | size); | ~~~~~ ../src/target/i386/emulate/x86_decode.c: In function 'calc_modrm_operand6= 4': ../src/target/i386/emulate/x86_decode.c:1702:18: note: 'val' declared here 1702 | target_ulong val =3D 0; | ^~~ In the calc_modrm_operand64() case the compiler sees size =3D=3D 8 to be me= m-copied to a target_ulong variable which is only 4 bytes wide in case of i386-softm= mu. Note that when size !=3D 1, get_reg_ref() always returns a pointer to an 8 = byte register, regardless of the target_ulong size. Fix the compiler warning by always providing 8 bytes of storage by means of uint64_t. Fixes: 77a2dba45cc9 ("target/i386/emulate: stop overloading decode->op[N].p= tr") cc: qemu-stable Signed-off-by: Bernhard Beschow --- target/i386/emulate/x86_decode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/emulate/x86_decode.c b/target/i386/emulate/x86_dec= ode.c index d037ed1142..6ad03b71b0 100644 --- a/target/i386/emulate/x86_decode.c +++ b/target/i386/emulate/x86_decode.c @@ -1699,7 +1699,7 @@ void *get_reg_ref(CPUX86State *env, int reg, int rex_= present, target_ulong get_reg_val(CPUX86State *env, int reg, int rex_present, int is_extended, int size) { - target_ulong val =3D 0; + uint64_t val =3D 0; memcpy(&val, get_reg_ref(env, reg, rex_present, is_extended, size), size); --=20 2.53.0