Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle getCondition() method of BranchInst #3

Open
BowenZhang-UST opened this issue Jun 19, 2023 · 1 comment
Open

Handle getCondition() method of BranchInst #3

BowenZhang-UST opened this issue Jun 19, 2023 · 1 comment

Comments

@BowenZhang-UST
Copy link

Commit

Latest Main

Location

  • value-range-analysis/Liveness.h
    • Line 234
    • Line 1092

Description

At Line 234, the condition of the BranchInst is dynamically casted into ICmpInst. However, the condition is not always ICmpInst. For example, it could be a CastInst which casts an i32 into an i1. In this case, the variable cmpInst would be null and a NPD will happen at line 236.
image
At Line 1092, the situation is similar.

Proposed Fix

guard this dyn_cast with a if

@wang-shijie
Copy link

wang-shijie commented Jun 19, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants