Fix T81340: UBSan: addition of unsigned offset causes overflow

The warning:
runtime error: addition of unsigned offset to 0x61a0000b22d8
overflowed to 0x61a0000b22b8

Fix T81340 (partially)

Reviewed By: campbellbarton

Maniphest Tasks: T81340

Differential Revision: https://developer.blender.org/D9063
This commit is contained in:
Ankit Meel
2020-10-01 11:55:14 +05:30
parent a4e14c3bfd
commit 63c906e0a7

View File

@@ -284,7 +284,7 @@ typedef struct BHeadN {
struct BHead bhead;
} BHeadN;
#define BHEADN_FROM_BHEAD(bh) ((BHeadN *)POINTER_OFFSET(bh, -offsetof(BHeadN, bhead)))
#define BHEADN_FROM_BHEAD(bh) ((BHeadN *)POINTER_OFFSET(bh, -(int)offsetof(BHeadN, bhead)))
/* We could change this in the future, for now it's simplest if only data is delayed
* because ID names are used in lookup tables. */