Skip to content

Commit

Permalink
Merge pull request #764 from rurban/master
Browse files Browse the repository at this point in the history
last found asan bug (I hope)
  • Loading branch information
petdance committed May 4, 2012
2 parents d3dcc4b + 1e5f20e commit a850da6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/pmc/structview.pmc
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,8 @@ Get/Set an integer-type element from a struct-pointer PMC.
{
UINTVAL ux = x;
size_t bits, n;
unsigned char tempc;
unsigned char *cptr = (unsigned char *)ptr;
unsigned char tempc = 0;
unsigned char *cptr = (unsigned char *)ptr;

switch (elts[i].type) {
case enum_type_uint1:
Expand All @@ -610,7 +610,9 @@ Get/Set an integer-type element from a struct-pointer PMC.
}

/* cache last byte (for restoring hi bits) */
tempc = cptr[(bits + elts[i].bit_offset)/8];
if (bits > 1) {
tempc = cptr[(bits + elts[i].bit_offset - 1)/8];
}

/* write hi bits of first byte */
n = 8 - elts[i].bit_offset;
Expand Down

0 comments on commit a850da6

Please sign in to comment.