Skip to content

Commit 27173c1

Browse files
committed
change it to static
1 parent 38a575b commit 27173c1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

source/loader/layers/sanitizer/asan_interceptor.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,10 @@ ur_result_t SanitizerInterceptor::prepareLaunch(
709709

710710
// Write debug
711711
// We use "uint64_t" here because EnqueueWriteGlobal will fail when it's "uint32_t"
712-
uint64_t Debug = Options(logger).Debug ? 1 : 0;
712+
// Because EnqueueWriteGlobal is a async write, so
713+
// we need to extend its lifetime
714+
static uint64_t Debug;
715+
Debug = Options(logger).Debug ? 1 : 0;
713716
EnqueueWriteGlobal(kSPIR_AsanDebug, &Debug, sizeof(Debug));
714717

715718
// Write shadow memory offset for global memory

0 commit comments

Comments
 (0)