Skip to content
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.

[ValueTracking] avoid crashing from bad assumptions (PR31809) #96

Merged

Conversation

arielb1
Copy link

@arielb1 arielb1 commented Nov 9, 2017

A program may contain llvm.assume info that disagrees with other analysis.
This may be caused by UB in the program, so we must not crash because of that.

As noted in the code comments:
https://llvm.org/bugs/show_bug.cgi?id=31809
...we can do better, but this at least avoids the assert/crash in the bug report.

Differential Revision: https://reviews.llvm.org/D29395

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293773 91177308-0d34-0410-b5e6-96231b3b80d8

A program may contain llvm.assume info that disagrees with other analysis. 
This may be caused by UB in the program, so we must not crash because of that.

As noted in the code comments:
https://llvm.org/bugs/show_bug.cgi?id=31809
...we can do better, but this at least avoids the assert/crash in the bug report.

Differential Revision: https://reviews.llvm.org/D29395


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293773 91177308-0d34-0410-b5e6-96231b3b80d8
@arielb1
Copy link
Author

arielb1 commented Nov 9, 2017

Yes I know this patch is ugly because it shadows the assertion in computeKnownBits instead of replacing it, but I want to stay consistent with upstream LLVM.

@alexcrichton
Copy link
Member

👍

@alexcrichton alexcrichton merged commit 896fb22 into rust-lang:rust-llvm-release-4-0-1 Nov 9, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants