From: Giovanni Mascellani Subject: Re: [PATCH vkd3d 7/8] vkd3d-shader/hlsl: Support negation for all numeric types in fold_constants(). Message-Id: Date: Fri, 7 Jan 2022 10:42:16 +0100 In-Reply-To: <20220106173949.82958-7-fcasas@codeweavers.com> References: <20220106173949.82958-7-fcasas@codeweavers.com> Hi, On 06/01/22 18:39, Francisco Casas wrote: > + case HLSL_TYPE_INT: > + tgt->value[k].i = -src->value[k].i; > + break; Alas, negation isn't safe either: -INT_MIN is undefined behavior, and you have to do the unsigned trick here too. Giovanni.