Skip to content

Commit

Permalink
Merge pull request GoSSIP-SJTU#3 from itcbx/patch-1
Browse files Browse the repository at this point in the history
Update StringObfuscation.cpp
  • Loading branch information
flysoar authored Jul 4, 2017
2 parents 5548947 + c5caeb2 commit 65c5a51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Transforms/Obfuscation/StringObfuscation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace llvm {
std::string section(gv->getSection());

// Let's encode the static ones
if (gv->isConstant() && gv->hasInitializer() && str_idx == 0 && section != "llvm.metadata") {
if (gv->isConstant() && gv->hasInitializer() && isa<ConstantDataSequential>(gv->getInitializer()) && section != "llvm.metadata" && section.find("__objc_methname") == std::string::npos) {
++GlobalsEncoded;
//errs() << " is constant";

Expand All @@ -62,7 +62,7 @@ namespace llvm {
(GlobalVariable*) 0,
gv->getThreadLocalMode(),
gv->getType()->getAddressSpace());
dynGV->copyAttributesFrom(gv);
// dynGV->copyAttributesFrom(gv);
dynGV->setInitializer(gv->getInitializer());

Constant *initializer = gv->getInitializer();
Expand Down

0 comments on commit 65c5a51

Please sign in to comment.