mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-28 08:02:08 +00:00
Fixed value evaluation to handle null constants.
<rdar://problem/14005311> llvm-svn: 183022
This commit is contained in:
parent
8aa7abe2ae
commit
7d01ddd6f8
@ -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());
|
||||
}
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user