Blender Git Loki

Git Commits -> Revision a31a87f

Revision a31a87f by Ankit Meel (master)
October 8, 2020, 17:44 (GMT)
T81340: UBSan: load of value .. not valid for GPU enum type

The underlying type of the enum cannot be fixed here due to its usage
in C code.

All the values possible in the width of the underlying type are not
valid for an enum.
Only 0 to (2*max - 1) if all enumerators are unsigned.
So the macro asks for the biggest value among the //listed// ones.
If any enumerator C is set to say `A|B`, then C would be the maximum.
(2*max-1) is used as the mask.

The warnings (for each enum modified in this commit):
GPU_vertex_buffer.h:43:1: runtime error: load of value 4294967291
which is not a valid value for type 'GPUVertBufStatus'

https://github.com/llvm/llvm-project/commit/1c2c9867

Ref T81340

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D9067

Commit Details:

Full Hash: a31a87f8943aa4029ff0f23a6dc46f5d0c895e8b
Parent Commit: 569510d
Lines Changed: +13, -12

8 Modified Paths:

/source/blender/blenlib/BLI_utildefines.h (+4, -3) (Diff)
/source/blender/gpu/GPU_batch.h (+1, -1) (Diff)
/source/blender/gpu/GPU_framebuffer.h (+1, -1) (Diff)
/source/blender/gpu/GPU_platform.h (+1, -1) (Diff)
/source/blender/gpu/GPU_state.h (+2, -2) (Diff)
/source/blender/gpu/GPU_texture.h (+1, -1) (Diff)
/source/blender/gpu/GPU_vertex_buffer.h (+1, -1) (Diff)
/source/blender/gpu/intern/gpu_texture_private.hh (+2, -2) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021