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

make the pointee type related to gep more robust #1303

Merged
merged 4 commits into from
Dec 29, 2023

Conversation

jumormt
Copy link
Contributor

@jumormt jumormt commented Dec 28, 2023

  1. assert that we can have at most one pointer type (normally the first index that simply pieces the base pointer) when bridging a gep instruction.

  2. remove the assertion checking in getelementNum because the pointee may be of a pointer type for the multi-level pointer, e.g., %2 = getelementptr inbounds i32*, i32** %1, ... the corresponding source code is like:

int getValue(int** arr, int x, int y) {
    return arr[x][y];
}

This can be transformed to: %2 = getelementptr inbounds [N x i32], [N x i32]* %1, ...
However, we do not know N without context information. int** implies non-contiguous blocks of memory. In this case, we conservatively return the max field limit.

Copy link

codecov bot commented Dec 28, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (a6f6832) 64.51% compared to head (a11b255) 64.51%.
Report is 2 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1303   +/-   ##
=======================================
  Coverage   64.51%   64.51%           
=======================================
  Files         223      223           
  Lines       23833    23836    +3     
=======================================
+ Hits        15376    15378    +2     
- Misses       8457     8458    +1     
Files Coverage Δ
svf-llvm/lib/SVFIRBuilder.cpp 78.37% <100.00%> (+0.08%) ⬆️
svf/lib/MemoryModel/AccessPath.cpp 3.15% <0.00%> (-0.04%) ⬇️

@yuleisui yuleisui merged commit 76e4d05 into SVF-tools:master Dec 29, 2023
5 checks passed
@jumormt jumormt deleted the gep branch December 30, 2023 04:59
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

Successfully merging this pull request may close these issues.

2 participants