corrected the treatment of the <<= and >>= operators
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
#include "atw.h"
|
||||
|
||||
#define CRASH() crash("EVAL: CRASH at line %u", __LINE__)
|
||||
#define roundup(n) ((n) < word_size ? word_size : (n))
|
||||
#define toword(n) ((n) < word_size ? word_size : (n))
|
||||
|
||||
char *symbol2str();
|
||||
char *long2str();
|
||||
@@ -374,6 +374,10 @@ EVAL(expr, val, code, true_label, false_label)
|
||||
case ANDAB:
|
||||
case XORAB:
|
||||
case ORAB:
|
||||
{
|
||||
arith old_offset;
|
||||
arith tmpvar = tmp_pointer_var(&old_offset);
|
||||
|
||||
#ifndef NOBITFIELD
|
||||
if (leftop->ex_type->tp_fund == FIELD) {
|
||||
eval_field(expr, code);
|
||||
@@ -381,34 +385,29 @@ EVAL(expr, val, code, true_label, false_label)
|
||||
}
|
||||
#endif NOBITFIELD
|
||||
if (leftop->ex_class != Value) {
|
||||
arith old_offset;
|
||||
arith tmpvar = tmp_pointer_var(&old_offset);
|
||||
|
||||
EVAL(leftop, LVAL, TRUE, NO_LABEL, NO_LABEL);
|
||||
C_lal(tmpvar);
|
||||
C_sti(pointer_size);
|
||||
C_lal(tmpvar);
|
||||
C_loi(pointer_size);
|
||||
C_loi(leftop->ex_type->tp_size);
|
||||
conversion(leftop->ex_type, tp);
|
||||
EVAL(rightop, RVAL, TRUE, NO_LABEL, NO_LABEL);
|
||||
assop(tp, oper);
|
||||
conversion(tp, leftop->ex_type);
|
||||
if (gencode)
|
||||
C_dup(roundup(leftop->ex_type->tp_size));
|
||||
}
|
||||
else {
|
||||
load_val(leftop, RVAL);
|
||||
}
|
||||
conversion(leftop->ex_type, tp);
|
||||
EVAL(rightop, RVAL, TRUE, NO_LABEL, NO_LABEL);
|
||||
assop(tp, oper);
|
||||
conversion(tp, leftop->ex_type);
|
||||
if (gencode)
|
||||
C_dup(toword(leftop->ex_type->tp_size));
|
||||
if (leftop->ex_class != Value) {
|
||||
C_lal(tmpvar);
|
||||
C_loi(pointer_size);
|
||||
C_sti(leftop->ex_type->tp_size);
|
||||
free_tmp_var(old_offset);
|
||||
}
|
||||
else {
|
||||
load_val(leftop, RVAL);
|
||||
conversion(leftop->ex_type, tp);
|
||||
EVAL(rightop, RVAL, TRUE, NO_LABEL, NO_LABEL);
|
||||
assop(tp, oper);
|
||||
conversion(tp, leftop->ex_type);
|
||||
if (gencode)
|
||||
C_dup(roundup(leftop->ex_type->tp_size));
|
||||
else {
|
||||
store_val(
|
||||
&(leftop->ex_object.ex_value),
|
||||
leftop->ex_type
|
||||
@@ -417,6 +416,7 @@ EVAL(expr, val, code, true_label, false_label)
|
||||
if (gencode)
|
||||
conversion(leftop->ex_type, expr->ex_type);
|
||||
break;
|
||||
}
|
||||
case '(':
|
||||
{
|
||||
register struct expr *expr;
|
||||
|
||||
Reference in New Issue
Block a user