[Lldb-commits] [lldb] r180215 - Fixed expression parser handling of empty strings.
Sean Callanan
scallanan at apple.com
Wed Apr 24 12:50:12 PDT 2013
Author: spyffe
Date: Wed Apr 24 14:50:12 2013
New Revision: 180215
URL: http://llvm.org/viewvc/llvm-project?rev=180215&view=rev
Log:
Fixed expression parser handling of empty strings.
<rdar://problem/12977827>
Modified:
lldb/trunk/source/Expression/IRForTarget.cpp
lldb/trunk/test/lang/c/strings/TestCStrings.py
Modified: lldb/trunk/source/Expression/IRForTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRForTarget.cpp?rev=180215&r1=180214&r2=180215&view=diff
==============================================================================
--- lldb/trunk/source/Expression/IRForTarget.cpp (original)
+++ lldb/trunk/source/Expression/IRForTarget.cpp Wed Apr 24 14:50:12 2013
@@ -1465,6 +1465,11 @@ IRForTarget::MaterializeInitializer (uin
}
return true;
}
+ else if (isa<ConstantAggregateZero>(initializer))
+ {
+ memset(data, 0, m_target_data->getTypeStoreSize(initializer_type));
+ return true;
+ }
return false;
}
Modified: lldb/trunk/test/lang/c/strings/TestCStrings.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/strings/TestCStrings.py?rev=180215&r1=180214&r2=180215&view=diff
==============================================================================
--- lldb/trunk/test/lang/c/strings/TestCStrings.py (original)
+++ lldb/trunk/test/lang/c/strings/TestCStrings.py Wed Apr 24 14:50:12 2013
@@ -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()
More information about the lldb-commits
mailing list