Fixed expression parser handling of empty strings.

<rdar://problem/12977827>

llvm-svn: 180215
This commit is contained in:
Sean Callanan 2013-04-24 19:50:12 +00:00
parent 75c3036d4b
commit 76ee3e7e1c
2 changed files with 8 additions and 0 deletions

View File

@ -1465,6 +1465,11 @@ IRForTarget::MaterializeInitializer (uint8_t *data, Constant *initializer)
}
return true;
}
else if (isa<ConstantAggregateZero>(initializer))
{
memset(data, 0, m_target_data->getTypeStoreSize(initializer_type));
return true;
}
return false;
}

View File

@ -63,6 +63,9 @@ class CStringsTestCase(TestBase):
substrs = ['(char *) $', ' = 0x',
'hello'])
self.expect("p (int)strlen(\"\")",
substrs = ['(int) $', ' = 0'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()