Skip to content

Termination: Unsound result with backend IMC? #472

@pwnchaser

Description

@pwnchaser

Hi, thanks for fixing my previous bug,
I may have another one, this time with --backend IMC:

void f(int x){  // x == -1
  while (x < 0){
  }
}

int main() {
  unsigned int allOne = 0xffffffff;
  f(allOne);
  long castToLong = allOne;
  return 0;
}

Theta says this is a terminating-program, but in fact when the unsigned integer is casted to signed, this is a negative number and the loop does not terminate.
It seems that there is an interplay with the unused variable castToLong as dropping this variable makes Theta return SafetyResult Unsafe as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions