From 1d5124efb3bc7173ec6f9961a865f2e167f5198f Mon Sep 17 00:00:00 2001 From: Marius Hillenbrand Date: Wed, 10 Nov 2021 18:10:58 +0100 Subject: [PATCH 2/3] TIntermediate::promoteConstantUnion(): fix conversion to int8 The signedness of type char is implementation-defined in C++. The conversion to (signed) int8 currently uses a cast to char, which is undefined for negative values when the type char is implemented as unsigned. Thus, fix to cast to "signed char", which has the intended semantic on all implementations. Fixes #2807 --- .../glslang/glslang/MachineIndependent/Intermediate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp b/src/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp index 84b4c55..89538ea 100644 --- a/src/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp +++ b/src/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp @@ -3867,7 +3867,7 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC case EbtFloat16: PROMOTE(setDConst, double, Get); break; \ case EbtFloat: PROMOTE(setDConst, double, Get); break; \ case EbtDouble: PROMOTE(setDConst, double, Get); break; \ - case EbtInt8: PROMOTE(setI8Const, char, Get); break; \ + case EbtInt8: PROMOTE(setI8Const, signed char, Get); break; \ case EbtInt16: PROMOTE(setI16Const, short, Get); break; \ case EbtInt: PROMOTE(setIConst, int, Get); break; \ case EbtInt64: PROMOTE(setI64Const, long long, Get); break; \ -- 2.35.1