Skip to content

Commit 80dbc50

Browse files
Enable TSan validation to detect when a mutable accessor of a message is called concurrently with another accessor on the same message, which is a data race.
This is the second phase, in which we enable validation for enum/primitive fields. PiperOrigin-RevId: 543475296
1 parent f10e56c commit 80dbc50

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/google/protobuf/port_def.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,11 +863,11 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
863863
// TODO(b/280674214): enable these macros in phases. The phases are: repeated
864864
// fields/maps, enum/primitive fields, string fields, message fields.
865865
#define PROTOBUF_TSAN_READ_REPEATED(addr) PROTOBUF_TSAN_READ(addr)
866-
#define PROTOBUF_TSAN_READ_PRIMITIVE(addr)
866+
#define PROTOBUF_TSAN_READ_PRIMITIVE(addr) PROTOBUF_TSAN_READ(addr)
867867
#define PROTOBUF_TSAN_READ_STRING(addr)
868868
#define PROTOBUF_TSAN_READ_MESSAGE(addr)
869869
#define PROTOBUF_TSAN_WRITE_REPEATED(addr) PROTOBUF_TSAN_WRITE(addr)
870-
#define PROTOBUF_TSAN_WRITE_PRIMITIVE(addr)
870+
#define PROTOBUF_TSAN_WRITE_PRIMITIVE(addr) PROTOBUF_TSAN_WRITE(addr)
871871
#define PROTOBUF_TSAN_WRITE_STRING(addr)
872872
#define PROTOBUF_TSAN_WRITE_MESSAGE(addr)
873873

0 commit comments

Comments
 (0)