fix to bitfield code: contained non-portable shift
This commit is contained in:
parent
9197c959dc
commit
8c9c04b549
|
@ -28,6 +28,7 @@
|
|||
|
||||
arith NewLocal(); /* util.c */
|
||||
char *symbol2str(); /* symbol2str.c */
|
||||
extern long full_mask[]; /* cstoper.c */
|
||||
|
||||
/* Eval_field() evaluates expressions involving bit fields.
|
||||
The various instructions are not yet optimised in the expression
|
||||
|
@ -72,7 +73,7 @@ eval_field(expr, code)
|
|||
C_slu(asize);
|
||||
else
|
||||
C_sli(asize);
|
||||
C_loc(~((fd->fd_mask << fd->fd_shift) | (~0 << (8 * asize))));
|
||||
C_loc(~((fd->fd_mask << fd->fd_shift) | ~full_mask[asize]));
|
||||
if (leftop->ex_depth == 0) { /* simple case */
|
||||
load_val(leftop, RVAL);
|
||||
C_and(asize);
|
||||
|
@ -142,7 +143,7 @@ eval_field(expr, code)
|
|||
C_slu(asize);
|
||||
else
|
||||
C_sli(asize);
|
||||
C_loc(~((fd->fd_mask << fd->fd_shift) | (~0 << (8 * asize))));
|
||||
C_loc(~((fd->fd_mask << fd->fd_shift) | ~full_mask[asize]));
|
||||
if (leftop->ex_depth == 0) {
|
||||
load_val(leftop, RVAL);
|
||||
C_and(asize);
|
||||
|
|
Loading…
Reference in a new issue