static int assignment64_stop_before_condition_operator = 0;
static int call_argument_preserve_wide_member_address = 0;
+static int assignment64_stop_before_logical_operator = 0;
+static int assignment64_expression_depth = 0;
static void masm_flush_data_line (void);
static int postfix_member_pointer_depth = 0;
}
-static void emit_load_assignment_rhs_expression_to_pair (const char *lo, const char *hi, int is_unsigned) {
+static void emit_load_assignment_rhs_expression_to_pair_internal (const char *lo, const char *hi, int is_unsigned) {
enum token_kind op;
emit_load_assignment_rhs_to_pair (lo, hi);
- while (is_assignment64_binary_operator (tok.kind) && !(assignment64_stop_before_condition_operator && is_assignment64_condition_stop_operator (tok.kind))) {
+ while (is_assignment64_binary_operator (tok.kind) &&
+ !(assignment64_stop_before_condition_operator && is_assignment64_condition_stop_operator (tok.kind)) &&
+ !(assignment64_stop_before_logical_operator == assignment64_expression_depth &&
+ (tok.kind == TOK_LOGAND || tok.kind == TOK_LOGOR))) {
op = tok.kind;
get_token ();
}
+static void emit_load_assignment_rhs_expression_to_pair (const char *lo, const char *hi, int is_unsigned) {
+
+ ++assignment64_expression_depth;
+
+ emit_load_assignment_rhs_expression_to_pair_internal (lo, hi, is_unsigned);
+ --assignment64_expression_depth;
+
+}
+
static void emit_incdec_integral_symbol_now (struct local_symbol *sym, const char *name, int size, enum token_kind op) {
char memref[64];
statement_condition_constant_known = 0;
statement_condition_constant_value = 0;
+ if (tok.kind != TOK_XMARK && (current_expression_mentions_64bit_symbol_now () || source_starts_64bit_integer_cast_now (tok.caret))) {
+ goto wide_condition;
+ }
+
if (emit_statement_ident_immediate_compare_jump_if_false_now (label)) {
return;
}
}
- if (current_expression_mentions_64bit_symbol_now ()) {
+wide_condition:
+
+ if (current_expression_mentions_64bit_symbol_now () || source_starts_64bit_integer_cast_now (tok.caret)) {
int old_assignment64_stop_before_condition_operator;
+ int old_assignment64_stop_before_logical_operator;
+
+ int cast_size, cast_unsigned;
is_unsigned = rhs_current_operand_is_unsigned_now ();
+ if (source_starts_integer_cast_size_now (tok.caret, &cast_size, &cast_unsigned) && cast_size == (DATA_LLONG & 0x1f) && cast_unsigned) {
+ is_unsigned = 1;
+ }
+
old_assignment64_stop_before_condition_operator = assignment64_stop_before_condition_operator;
assignment64_stop_before_condition_operator = 1;
* stop at the nested == and leave the parser expecting the closing
* ')'. That is what produced the false "expected )" diagnostic.
*/
+ old_assignment64_stop_before_logical_operator = assignment64_stop_before_logical_operator;
+ assignment64_stop_before_logical_operator = assignment64_expression_depth + 1;
+
emit_load_assignment_rhs_expression_to_pair ("eax", "edx", is_unsigned);
+ assignment64_stop_before_logical_operator = old_assignment64_stop_before_logical_operator;
if (state->ofp) {
}
- emit_statement_test_eax_jump_if_false (label);
+ emit_statement_eax_truth_jump_if_false_and_tail (label);
return;
}