forked from OSchip/llvm-project
parent
7681afdff0
commit
9be91e970e
|
@ -0,0 +1,16 @@
|
|||
// RUN: %clangxx_msan -m64 -O0 %s -o %t && %t
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
extern char *tzname[2];
|
||||
|
||||
int main(void) {
|
||||
if (!strlen(tzname[0]) || !strlen(tzname[1]))
|
||||
exit(1);
|
||||
tzset();
|
||||
if (!strlen(tzname[0]) || !strlen(tzname[1]))
|
||||
exit(1);
|
||||
return 0;
|
||||
}
|
|
@ -1071,6 +1071,18 @@ INTERCEPTOR(int, pthread_join, void *th, void **retval) {
|
|||
return res;
|
||||
}
|
||||
|
||||
extern char *tzname[2];
|
||||
|
||||
INTERCEPTOR(void, tzset) {
|
||||
ENSURE_MSAN_INITED();
|
||||
REAL(tzset)();
|
||||
if (tzname[0])
|
||||
__msan_unpoison(tzname[0], REAL(strlen)(tzname[0]) + 1);
|
||||
if (tzname[1])
|
||||
__msan_unpoison(tzname[1], REAL(strlen)(tzname[1]) + 1);
|
||||
return;
|
||||
}
|
||||
|
||||
struct MSanInterceptorContext {
|
||||
bool in_interceptor_scope;
|
||||
};
|
||||
|
@ -1323,6 +1335,7 @@ void InitializeInterceptors() {
|
|||
INTERCEPT_FUNCTION(pthread_create);
|
||||
INTERCEPT_FUNCTION(pthread_key_create);
|
||||
INTERCEPT_FUNCTION(pthread_join);
|
||||
INTERCEPT_FUNCTION(tzset);
|
||||
inited = 1;
|
||||
}
|
||||
} // namespace __msan
|
||||
|
|
Loading…
Reference in New Issue