From: "Francisco Casas" Subject: Re: [PATCH vkd3d 7/8] vkd3d-shader/hlsl: Support negation for all numeric types in fold_constants(). Message-Id: <5e8086713ec0374f998ba1275c29f86a@codeweavers.com> Date: Fri, 07 Jan 2022 11:51:09 +0000 In-Reply-To: References: <20220106173949.82958-7-fcasas@codeweavers.com> January 7, 2022 6:42 AM, "Giovanni Mascellani" wrote: > 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. Good catch! I didn't knew that. Okay