Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
KomiMoe committed May 18, 2024
1 parent 14916c2 commit 25efdc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/Obfuscation/StringEncryption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ bool StringEncryption::runOnModule(Module &M) {
Entry->Data.push_back(static_cast<uint8_t>(Data[i]));
}
Entry->ID = static_cast<unsigned>(ConstantStringPool.size());
ConstantAggregateZero *ZeroInit = ConstantAggregateZero::get(CDS->getType());
Constant *ZeroInit = Constant::getNullValue(CDS->getType());
GlobalVariable *DecGV = new GlobalVariable(M, CDS->getType(), false, GlobalValue::PrivateLinkage,
ZeroInit, "dec" + Twine::utohexstr(Entry->ID) + GV.getName());
GlobalVariable *DecStatus = new GlobalVariable(M, Type::getInt32Ty(Ctx), false, GlobalValue::PrivateLinkage,
Expand Down Expand Up @@ -148,7 +148,7 @@ bool StringEncryption::runOnModule(Module &M) {
for (GlobalVariable *GV: ConstantStringUsers) {
if (isValidToEncrypt(GV)) {
Type *EltType = GV->getValueType();
ConstantAggregateZero *ZeroInit = ConstantAggregateZero::get(EltType);
Constant *ZeroInit = Constant::getNullValue(EltType);
GlobalVariable *DecGV = new GlobalVariable(M, EltType, false, GlobalValue::PrivateLinkage,
ZeroInit, "dec_" + GV->getName());
DecGV->setAlignment(MaybeAlign(GV->getAlignment()));
Expand Down

0 comments on commit 25efdc6

Please sign in to comment.