File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,8 @@ typedef unsigned long u64;
19
19
20
20
#define SHADOW_GRANULARITY (1ULL << ASAN_SHADOW)
21
21
22
- #define GET_CALLER_PC () (uptr) __builtin_return_address(0)
22
+ #define CALL_BYTES 4
23
+ #define GET_CALLER_PC () ((uptr)__builtin_return_address(0) - CALL_BYTES)
23
24
24
25
#define WORKGROUP_ID (dim ) __builtin_amdgcn_workgroup_id_##dim()
25
26
Original file line number Diff line number Diff line change @@ -333,6 +333,8 @@ __asan_free_impl(ulong aa, ulong pc)
333
333
if (!aa )
334
334
return ;
335
335
336
+ pc -= CALL_BYTES ;
337
+
336
338
uptr sa = MEM_TO_SHADOW (aa );
337
339
s8 sb = * (__global s8 * ) sa ;
338
340
if (sb != 0 && ((s8 )(aa & (SHADOW_GRANULARITY - 1 )) >= sb )) {
@@ -613,6 +615,8 @@ NO_SANITIZE_ADDR
613
615
ulong
614
616
__asan_malloc_impl (ulong sz , ulong pc )
615
617
{
618
+ pc -= CALL_BYTES ;
619
+
616
620
if (sz > SLAB_THRESHOLD )
617
621
return non_slab_malloc (sz , pc );
618
622
else
You can’t perform that action at this time.
0 commit comments