mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-21 03:37:47 +00:00
Use new method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10852 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
13cfdea1ef
commit
e3f84f53ca
@ -44,8 +44,7 @@ static std::string getStringValue(Value *V, unsigned Offset = 0) {
|
||||
if (GlobalVariable *GV = dyn_cast<GlobalVariable>(V)) {
|
||||
if (GV->hasInitializer() && isa<ConstantArray>(GV->getInitializer())) {
|
||||
ConstantArray *Init = cast<ConstantArray>(GV->getInitializer());
|
||||
if (Init->getType()->getElementType() == Type::SByteTy ||
|
||||
Init->getType()->getElementType() == Type::UByteTy) {
|
||||
if (Init->isString()) {
|
||||
std::string Result = Init->getAsString();
|
||||
if (Offset < Result.size()) {
|
||||
// If we are pointing INTO The string, erase the beginning...
|
||||
|
Loading…
x
Reference in New Issue
Block a user