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

Remove "STATIC" annotation in extapi.bc #1188

Merged
merged 4 commits into from
Sep 8, 2023

Conversation

shuangxiangkan
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Sep 7, 2023

Codecov Report

Merging #1188 (459880d) into master (324794b) will increase coverage by 0.01%.
Report is 1 commits behind head on master.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1188      +/-   ##
==========================================
+ Coverage   64.64%   64.66%   +0.01%     
==========================================
  Files         222      222              
  Lines       23525    23509      -16     
==========================================
- Hits        15207    15201       -6     
+ Misses       8318     8308      -10     
Files Changed Coverage Δ
svf-llvm/lib/LLVMUtil.cpp 73.70% <ø> (+1.01%) ⬆️
svf-llvm/lib/SymbolTableBuilder.cpp 85.99% <ø> (+1.37%) ⬆️
svf/include/Util/SVFUtil.h 90.78% <ø> (-0.88%) ⬇️
svf/lib/Util/ExtAPI.cpp 64.70% <ø> (-1.01%) ⬇️
svf-llvm/include/SVF-LLVM/LLVMUtil.h 76.25% <100.00%> (ø)
svf-llvm/lib/SVFIRExtAPI.cpp 80.00% <100.00%> (ø)
📢 Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None).

const unsigned short **__ctype_b_loc(void)
{
return NULL;
return malloc(10);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why malloc(10)? better to have a macro rather than a concrete number.

If you remove all STATIC functions, how about static functions mentioned here:
#1186


void *fdopen(int fd, const char *mode)
{
return STATIC_OBJECT;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, fdopen will (just like fopen & family) return a new object every time it's called, unless it's called with the same fd. Should this be ALLOC_RET instead? The behavior should probably be consistent with fopen at least, which is currently ALLOC_RET.

@adriaanjacobs
Copy link
Contributor

Looks good to me. To be clear: this resolves the issue of contradicting ALLOC_RET and STATIC annotations, but as far as I understand, we would still need a change to the format to support some of the more complex extapi behavior discussed in #1186, is that correct?

Regardless, this looks good. The fdopen thing has been present for a long(er) time, just never thought to comment on it.

@yuleisui yuleisui merged commit 0d9f7cf into SVF-tools:master Sep 8, 2023
5 checks passed
JasonZhongZexin pushed a commit to JasonZhongZexin/SVF-1 that referenced this pull request Sep 13, 2023
* Remove "STATIC" annotation in extapi.bc

* Return "STATIC_OBJECT" in an external function which has a static var that its return value points to

* Move the functions with annotations to the front of the functions without annotations in extapi.c

* annotate fdopen() with "ALLOC_RET"
yuleisui added a commit that referenced this pull request Sep 13, 2023
* fix vfspta read&write

* fix

* fix a nullptr dereference when creating AndersenSCD singleton instance

* Fix the bug of failing to find extapi.bc in npm

* Chang function names in ExtAPI

* SVF code formatter

* Add comments to some APIs in SVFIRExtAPI.cpp

* SVF code formatter

* fix getgepoffset and accumulateconstantOffset
support byte size

* refactor gepoffset api and accumulateOffset api
1. add getBytefromGepTypePair in SvfIR2ItvExeState
2. add getIndexfromGepTypePair in SvfIR2ItvExeState
3. add accumulateConstantByteOffset in AccessPath

* add comment to getGepByteOffset and accumulateConstantByteOffset

* SVF code formatter

* Remove "STATIC" annotation in extapi.bc (#1188)

* Remove "STATIC" annotation in extapi.bc

* Return "STATIC_OBJECT" in an external function which has a static var that its return value points to

* Move the functions with annotations to the front of the functions without annotations in extapi.c

* annotate fdopen() with "ALLOC_RET"

* fix a bug that leads to get many incorrect switch target case value -1 (#1191)

* fix a bug that leads to get many incorrect switch target value -1

* complete SVFIRBuilder about SwitchInst and make it easy understandable: get case successor basic block and related case value.

* add reshapeValue() to getOffsetfromGepPair (#1192)

* add reshapeValue() to getOffsetfromGepPair

* refactor getGepByteOffset and accumulateConstantByteOffset

* fix SVF CI compile err

---------

Co-authored-by: jiawei.wang <jiawei.wang@horizon.ai>

* SVF code formatter

* replace int64 with s64 in IntervalValue/Z3Expr (#1195)

* add reshapeValue() to getOffsetfromGepPair

* refactor getGepByteOffset and accumulateConstantByteOffset

* fix SVF CI compile err

* replace int64 with s64 to IntervalValue

* replace more int64 with s64

* replace more int64 with s64

* replace more int64 with s64

* replace more int64 with s64

* replace more int64 with s64

* replace more int64 with s64

---------

Co-authored-by: jiawei.wang <jiawei.wang@horizon.ai>

* SVF code formatter

update code

update changes

update

upate

---------

Co-authored-by: JasonZhongZexin <jason@PC-20220224QJOH.localdomain>
Co-authored-by: canliture <canliture@outlook.com>
Co-authored-by: shuangxiang kan <18550887212@163.com>
Co-authored-by: GitHub Actions Build <rockysui@gmail.com>
Co-authored-by: jiawei.wang <jiawei.wang@horizon.ai>
Co-authored-by: shuangxiang kan <47422069+shuangxiangkan@users.noreply.github.com>
Co-authored-by: Jiawei Wang <jackwang834@gmail.com>
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.

None yet

3 participants