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

fix a bug of int128 #1624

Merged
merged 7 commits into from
Jan 8, 2025
Merged

fix a bug of int128 #1624

merged 7 commits into from
Jan 8, 2025

Conversation

bjjwwang
Copy link
Contributor

@bjjwwang bjjwwang commented Jan 8, 2025

No description provided.

llvmModuleSet()->addToLLVMVal2SVFVarMap(
fpValue, pag->getGNode(iter->second));
}
else if (auto intValue = SVFUtil::dyn_cast<ConstantInt>(llvmValue))
{
pag->addConstantIntObjNode(iter->first, intValue->getSExtValue(), intValue->getZExtValue(), iter->second);
std::pair<s64_t, u64_t> intVal = LLVMUtil::getIntegerValue(intValue);
pag->addConstantIntObjNode(iter->first, intVal.first, intVal.second, iter->second);
Copy link
Collaborator

Choose a reason for hiding this comment

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

could you merge the 2nd and 3rd arguments as a pair?

Copy link

codecov bot commented Jan 8, 2025

Codecov Report

Attention: Patch coverage is 84.21053% with 6 lines in your changes missing coverage. Please review.

Project coverage is 62.85%. Comparing base (cfdbb6c) to head (f0d2c2a).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
svf-llvm/include/SVF-LLVM/LLVMUtil.h 71.42% 4 Missing ⚠️
svf-llvm/lib/DCHG.cpp 0.00% 1 Missing ⚠️
svf-llvm/lib/LLVMModule.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1624   +/-   ##
=======================================
  Coverage   62.84%   62.85%           
=======================================
  Files         247      247           
  Lines       27700    27720   +20     
  Branches     4545     4547    +2     
=======================================
+ Hits        17409    17424   +15     
- Misses      10291    10296    +5     
Files with missing lines Coverage Δ
svf-llvm/lib/CppUtil.cpp 87.02% <100.00%> (ø)
svf-llvm/lib/ICFGBuilder.cpp 100.00% <100.00%> (ø)
svf-llvm/lib/ObjTypeInference.cpp 95.19% <100.00%> (ø)
svf-llvm/lib/SVFIRBuilder.cpp 83.87% <100.00%> (+0.08%) ⬆️
svf-llvm/lib/SVFIRExtAPI.cpp 85.36% <100.00%> (+0.11%) ⬆️
svf-llvm/lib/SymbolTableBuilder.cpp 89.27% <100.00%> (ø)
svf/include/SVFIR/SVFIR.h 92.30% <100.00%> (ø)
svf-llvm/lib/DCHG.cpp 0.00% <0.00%> (ø)
svf-llvm/lib/LLVMModule.cpp 81.06% <0.00%> (ø)
svf-llvm/include/SVF-LLVM/LLVMUtil.h 77.77% <71.42%> (-1.82%) ⬇️

@@ -585,10 +585,10 @@ class SVFIR : public IRGraph
return addNode(node, i);
}

inline NodeID addConstantIntValNode(const SVFValue* curInst, s64_t sval, u64_t zval, const NodeID i,
inline NodeID addConstantIntValNode(const SVFValue* curInst, std::pair<s64_t, u64_t> intValue, const NodeID i,
Copy link
Collaborator

Choose a reason for hiding this comment

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

std::pair<s64_t, u64_t>&

Copy link
Collaborator

Choose a reason for hiding this comment

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

std::pair<s64_t, u64_t>& intValue

@@ -656,13 +656,12 @@ class SVFIR : public IRGraph
}


inline NodeID addConstantIntObjNode(const SVFValue* curInst, s64_t sval, u64_t zval, const NodeID i)
{
inline NodeID addConstantIntObjNode(const SVFValue* curInst, std::pair<s64_t, u64_t> intValue, const NodeID i) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

std::pair<s64_t, u64_t>&

@@ -64,7 +64,7 @@ const Type* SVFIRBuilder::getBaseTypeAndFlattenedFields(const Value* V, std::vec
{
SymbolTableBuilder builder(pag->getSymbolInfo());
builder.collectSym(offset);
pag->addConstantIntValNode(svfOffset, offset->getSExtValue(), offset->getZExtValue(), pag->getSymbolInfo()->getValSym(svfOffset), nullptr);
pag->addConstantIntValNode(svfOffset, std::make_pair(offset->getSExtValue(), offset->getZExtValue()), pag->getSymbolInfo()->getValSym(svfOffset), nullptr);
Copy link
Collaborator

Choose a reason for hiding this comment

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

LLVMUtil::getIntegerValue(offset)

Copy link
Collaborator

Choose a reason for hiding this comment

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

std::make_pair(offset->getSExtValue(), offset->getZExtValue()) => LLVMUtil::getIntegerValue(offset)

@yuleisui yuleisui merged commit a5cd486 into SVF-tools:master Jan 8, 2025
5 checks passed
jumormt pushed a commit to jumormt/SVF-xiao that referenced this pull request Jan 9, 2025
* fix a bug of int128

* wrap integer value function

* revise the std::make_pair

* Revert "revise the std::make_pair"

This reverts commit 75be147.

* fix addConstantIntObjNode and addConstantIntValNode

* remove getSExt ZExt in SVF-LLVM

---------

Co-authored-by: bjjwwang <bjjwwang@github.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.

2 participants