forked from len0rd/rockbox
Fix tree.c static allocation detection during buffer move
Change-Id: I170177ff331f33961863eff0dd3ba5c570a3961d
This commit is contained in:
parent
1d893a05c6
commit
60f60d9a12
1 changed files with 1 additions and 1 deletions
|
|
@ -1044,7 +1044,7 @@ static int move_callback(int handle, void* current, void* new)
|
||||||
if (cache->lock_count > 0)
|
if (cache->lock_count > 0)
|
||||||
return BUFLIB_CB_CANNOT_MOVE;
|
return BUFLIB_CB_CANNOT_MOVE;
|
||||||
|
|
||||||
ptrdiff_t diff = (int32_t *) new - (int32_t *) current;
|
ptrdiff_t diff = new - current;
|
||||||
/* FIX_PTR makes sure to not accidentally update static allocations */
|
/* FIX_PTR makes sure to not accidentally update static allocations */
|
||||||
#define FIX_PTR(x) \
|
#define FIX_PTR(x) \
|
||||||
{ if ((void*)x >= current && (void*)x < (current+cache->name_buffer_size)) x+= diff; }
|
{ if ((void*)x >= current && (void*)x < (current+cache->name_buffer_size)) x+= diff; }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue