From 8c9c04b54958e91d19186469cbaff8a23629d45c Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 9 Oct 1989 13:42:39 +0000 Subject: [PATCH] fix to bitfield code: contained non-portable shift --- lang/cem/cemcom/field.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lang/cem/cemcom/field.c b/lang/cem/cemcom/field.c index 3b944310b..1970ef265 100644 --- a/lang/cem/cemcom/field.c +++ b/lang/cem/cemcom/field.c @@ -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);