mc-imperial / dredd

Framework for evaluating C/C++ compiler testing tools
Apache License 2.0
11 stars 3 forks source link

Incorrect mutation of direct initialization with comma #237

Closed JamesLee-Jones closed 2 months ago

JamesLee-Jones commented 3 months ago

Dredd incorrectly mutates direct initialization of variables using the comma operator. The following:

int main() {
  int b((1,0));
}

Gets mutated to:

# Dredd prelude
int main() {
  int b((__dredd_replace_expr_int_zero(__dredd_replace_expr_int_one(1, 0),__dredd_replace_expr_int_zero(0, 3), 5)));
}

This leads __dredd_replace_expr_int_zero take in three arguments when it should only take in two.