Files
redis/src
Binbin ca174e1d47 Fix sanitizer warning, use offsetof instread of member_offset (#11539)
In #11511 we introduced member_offset which has a sanitizer warning:
```
multi.c:390:26: runtime error: member access within null pointer of type 'watchedKey' (aka 'struct watchedKey')
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior multi.c:390:26
```

We can use offsetof() from stddef.h. This is part of the standard lib
just to avoid this UB :) Sanitizer should not complain after we change
this.

1. Use offsetof instead of member_offset, so we can delete this now
2. Changed (uint8_t*) cast to (char*).

This does not matter much but according to standard, we are only allowed
to cast pointers to its own type, char* and void*. Let's try to follow
the rules.

This change was suggested by tezc and the comments is also from him.

Co-authored-by: Ozan Tezcan <ozantezcan@gmail.com>
2022-11-24 15:38:09 +02:00
..
2022-11-23 17:39:08 +02:00
2022-11-23 17:39:08 +02:00
2022-08-22 15:01:40 +08:00
2022-08-22 15:01:40 +08:00
2022-11-09 19:50:07 +02:00
2020-04-24 17:11:21 -07:00
2022-11-09 19:50:07 +02:00
2021-12-19 17:52:23 +02:00
2022-11-09 19:50:07 +02:00
2022-11-09 19:50:07 +02:00
2022-03-09 13:58:23 +02:00
2020-05-05 23:35:08 -04:00
2022-08-23 12:37:56 +03:00
2022-11-23 17:39:08 +02:00
2022-04-17 15:43:22 +03:00
2014-08-08 10:05:32 +02:00
2022-10-02 13:56:45 +03:00
2022-08-23 12:37:56 +03:00
2021-07-10 10:04:54 -05:00
2022-11-16 20:29:46 +02:00
2014-07-02 16:31:22 +02:00
2022-07-18 10:56:26 +03:00
2022-11-09 19:50:07 +02:00