Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#FFCCCC
langc
int func(int expr) {
  switch(expr){
    int i = 4;
    f(i);
  case 0:
    i = 17;
  /* Falls through into default code */
  default:
    printf(“%d\n”"%d\n"€, i);
  }
  return 0;
}

Implementation Details

...

Code Block
bgColor#ccccff
langc
int func(int expr) {
  int i = 4;    /* Move the code outside the switch block */
  f(i);         /* Now the statements will get executed */

  switch(expr) {
    case 0:
      i = 17;
      /* Falls through into default code */
    default:
      printf(“%d\n”"€œ%d\n"€, i);
  }
  return 0;
}

Risk Assessment

...