Fixed value evaluation to handle null constants.

<rdar://problem/14005311>

llvm-svn: 183022
This commit is contained in:
Sean Callanan 2013-05-31 17:29:03 +00:00
parent 8aa7abe2ae
commit 7d01ddd6f8
2 changed files with 8 additions and 1 deletions

View File

@ -151,7 +151,11 @@ public:
if (constant)
{
if (const ConstantInt *constant_int = dyn_cast<ConstantInt>(constant))
if (isa<ConstantPointerNull>(constant))
{
return AssignToMatchType(scalar, 0, value->getType());
}
else if (const ConstantInt *constant_int = dyn_cast<ConstantInt>(constant))
{
return AssignToMatchType(scalar, constant_int->getLimitedValue(), value->getType());
}

View File

@ -66,6 +66,9 @@ class CStringsTestCase(TestBase):
self.expect("p (int)strlen(\"\")",
substrs = ['(int) $', ' = 0'])
self.expect("expression !z",
substrs = ['false'])
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()