TIntermediate::promoteConstantUnion(): fix conversion to int8
authorMarius Hillenbrand <mhillen@linux.ibm.com>
Wed, 10 Nov 2021 17:10:58 +0000 (18:10 +0100)
committerMarius Hillenbrand <mhillen@linux.ibm.com>
Fri, 12 Nov 2021 09:35:31 +0000 (10:35 +0100)
commitf1fa8afa25c99a550b3d80c516b7cfa3ac725de5
treea316a8a62859aa9231a59570189cf5cbbc591107
parent925503088e2bcd76921b1e102c37fc320bace254
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/MachineIndependent/Intermediate.cpp