Skip to content

Commit

Permalink
i#1734 Create Dr.Fuzz: fix shadow buffer size calculation bug
Browse files Browse the repository at this point in the history
- fix a bug on calculating shadow buffer size: size forward alignment
  before division

Review-URL: https://codereview.appspot.com/272300043
  • Loading branch information
zhaoqin committed Nov 2, 2015
1 parent 8a1bb53 commit 3f7f925
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drmemory/shadow.c
Expand Up @@ -164,7 +164,7 @@ typedef struct _saved_region_t {

/* extend size to uint boundary if the exact required size is not already aligned */
#define SIZEOF_SAVED_BUFFER_SHADOW(size) \
(ALIGN_FORWARD(((size) / SHADOW_GRANULARITY), SHADOW_GRANULARITY))
(ALIGN_FORWARD((size), SHADOW_GRANULARITY) / SHADOW_GRANULARITY)

/* single allocation for saved_region_t and its shadow buffer */
#define SIZEOF_SAVED_BUFFER(size) \
Expand Down

0 comments on commit 3f7f925

Please sign in to comment.