Skip to content

Commit 0974c89

Browse files
committed
updating stale values
1 parent cd0cb21 commit 0974c89

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

php/ext/google/protobuf/php-upb.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,7 @@ UPB_INLINE uint8_t _upb_Xsan_NextTag(upb_Xsan *xsan) {
843843
}
844844
return xsan->state;
845845
#else
846+
UPB_UNUSED(xsan);
846847
return 0;
847848
#endif
848849
}
@@ -859,13 +860,27 @@ UPB_INLINE uint8_t UPB_PRIVATE(_upb_Xsan_GetTag)(const void *addr) {
859860
#if UPB_HWASAN
860861
return __hwasan_get_tag_from_pointer(addr);
861862
#else
863+
UPB_UNUSED(addr);
862864
return 0;
863865
#endif
864866
}
865867

866868
UPB_INLINE void UPB_PRIVATE(upb_Xsan_Init)(upb_Xsan *xsan) {
867869
#if UPB_HWASAN || UPB_TSAN
868870
xsan->state = 0;
871+
#else
872+
UPB_UNUSED(xsan);
873+
#endif
874+
}
875+
876+
UPB_INLINE void UPB_PRIVATE(upb_Xsan_MarkInitialized)(void* addr, size_t size) {
877+
#if UPB_HAS_FEATURE(memory_sanitizer)
878+
if (size) {
879+
__msan_unpoison(addr, size);
880+
}
881+
#else
882+
UPB_UNUSED(addr);
883+
UPB_UNUSED(size);
869884
#endif
870885
}
871886

@@ -878,6 +893,9 @@ UPB_INLINE void UPB_PRIVATE(upb_Xsan_PoisonRegion)(const void *addr,
878893
__asan_poison_memory_region(addr, size);
879894
#elif UPB_HWASAN
880895
__hwasan_tag_memory(addr, UPB_HWASAN_POISON_TAG, UPB_ALIGN_MALLOC(size));
896+
#else
897+
UPB_UNUSED(addr);
898+
UPB_UNUSED(size);
881899
#endif
882900
}
883901

@@ -955,13 +973,17 @@ UPB_INLINE void UPB_PRIVATE(upb_Xsan_AccessReadOnly)(upb_Xsan *xsan) {
955973
#if UPB_TSAN
956974
// For performance we avoid using a volatile variable.
957975
__asm__ volatile("" ::"r"(xsan->state));
976+
#else
977+
UPB_UNUSED(xsan);
958978
#endif
959979
}
960980

961981
UPB_INLINE void UPB_PRIVATE(upb_Xsan_AccessReadWrite)(upb_Xsan *xsan) {
962982
#if UPB_TSAN
963983
// For performance we avoid using a volatile variable.
964984
__asm__ volatile("" : "+r"(xsan->state));
985+
#else
986+
UPB_UNUSED(xsan);
965987
#endif
966988
}
967989

ruby/ext/google/protobuf_c/ruby-upb.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,7 @@ UPB_INLINE uint8_t _upb_Xsan_NextTag(upb_Xsan *xsan) {
845845
}
846846
return xsan->state;
847847
#else
848+
UPB_UNUSED(xsan);
848849
return 0;
849850
#endif
850851
}
@@ -861,13 +862,27 @@ UPB_INLINE uint8_t UPB_PRIVATE(_upb_Xsan_GetTag)(const void *addr) {
861862
#if UPB_HWASAN
862863
return __hwasan_get_tag_from_pointer(addr);
863864
#else
865+
UPB_UNUSED(addr);
864866
return 0;
865867
#endif
866868
}
867869

868870
UPB_INLINE void UPB_PRIVATE(upb_Xsan_Init)(upb_Xsan *xsan) {
869871
#if UPB_HWASAN || UPB_TSAN
870872
xsan->state = 0;
873+
#else
874+
UPB_UNUSED(xsan);
875+
#endif
876+
}
877+
878+
UPB_INLINE void UPB_PRIVATE(upb_Xsan_MarkInitialized)(void* addr, size_t size) {
879+
#if UPB_HAS_FEATURE(memory_sanitizer)
880+
if (size) {
881+
__msan_unpoison(addr, size);
882+
}
883+
#else
884+
UPB_UNUSED(addr);
885+
UPB_UNUSED(size);
871886
#endif
872887
}
873888

@@ -880,6 +895,9 @@ UPB_INLINE void UPB_PRIVATE(upb_Xsan_PoisonRegion)(const void *addr,
880895
__asan_poison_memory_region(addr, size);
881896
#elif UPB_HWASAN
882897
__hwasan_tag_memory(addr, UPB_HWASAN_POISON_TAG, UPB_ALIGN_MALLOC(size));
898+
#else
899+
UPB_UNUSED(addr);
900+
UPB_UNUSED(size);
883901
#endif
884902
}
885903

@@ -957,13 +975,17 @@ UPB_INLINE void UPB_PRIVATE(upb_Xsan_AccessReadOnly)(upb_Xsan *xsan) {
957975
#if UPB_TSAN
958976
// For performance we avoid using a volatile variable.
959977
__asm__ volatile("" ::"r"(xsan->state));
978+
#else
979+
UPB_UNUSED(xsan);
960980
#endif
961981
}
962982

963983
UPB_INLINE void UPB_PRIVATE(upb_Xsan_AccessReadWrite)(upb_Xsan *xsan) {
964984
#if UPB_TSAN
965985
// For performance we avoid using a volatile variable.
966986
__asm__ volatile("" : "+r"(xsan->state));
987+
#else
988+
UPB_UNUSED(xsan);
967989
#endif
968990
}
969991

0 commit comments

Comments
 (0)