File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,8 @@ extern "C++" template <typename T> struct FlexibleArray : T {
154
154
#define _CFI_ADDENDUM_BITS 1
155
155
/* Value of the addendum presence flag */
156
156
#define _CFI_ADDENDUM_FLAG 1
157
+ /* Allocator index mask */
158
+ #define _CFI_ALLOCATOR_IDX_MASK 0b00001110
157
159
158
160
typedef struct CFI_cdesc_t {
159
161
_CFI_CDESC_T_HEADER_MEMBERS
@@ -169,9 +171,10 @@ typedef struct CFI_cdesc_t {
169
171
}
170
172
RT_API_ATTRS inline void SetHasAddendum () { extra |= _CFI_ADDENDUM_FLAG; }
171
173
RT_API_ATTRS inline int GetAllocIdx () const {
172
- return (( int ) extra >> _CFI_ADDENDUM_BITS) ;
174
+ return (extra & _CFI_ALLOCATOR_IDX_MASK) >> _CFI_ADDENDUM_BITS;
173
175
}
174
176
RT_API_ATTRS inline void SetAllocIdx (int pos) {
177
+ extra &= ~_CFI_ALLOCATOR_IDX_MASK; // Clear the allocator index bits.
175
178
extra |= (pos << _CFI_ADDENDUM_BITS);
176
179
}
177
180
#endif
You can’t perform that action at this time.
0 commit comments