summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/ClangUserExpression.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2011-01-24 08:11:45 +0000
committerSean Callanan <scallanan@apple.com>2011-01-24 08:11:45 +0000
commit9d2127ad3c929bf40b6e58af106cd52e3fe5a15c (patch)
treeba0fcbdc99bde3c985cb8f2bc1f6e15c9bdc14e1 /lldb/source/Expression/ClangUserExpression.cpp
parentd58ac45c92e3245a41652d3f4e5266133f8735ac (diff)
downloadbcm5719-llvm-9d2127ad3c929bf40b6e58af106cd52e3fe5a15c.tar.gz
bcm5719-llvm-9d2127ad3c929bf40b6e58af106cd52e3fe5a15c.zip
Fixed a bug in the expression code which caused
it to interpret a "this" variable that was merely a pointer -- that is, not a class pointer -- as meaning that the current context was inside a C++ method. This bug would prevent expressions from evaluating correctly in regular C code if there was a pointer variable named "this" in scope. llvm-svn: 124117
Diffstat (limited to 'lldb/source/Expression/ClangUserExpression.cpp')
-rw-r--r--lldb/source/Expression/ClangUserExpression.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lldb/source/Expression/ClangUserExpression.cpp b/lldb/source/Expression/ClangUserExpression.cpp
index 4142c5c8c0e..73c7441b322 100644
--- a/lldb/source/Expression/ClangUserExpression.cpp
+++ b/lldb/source/Expression/ClangUserExpression.cpp
@@ -89,11 +89,14 @@ ClangUserExpression::ScanContext(ExecutionContext &exe_ctx)
{
TypeFromUser target_ast_type(pointer_target_type, this_type->GetClangAST());
- if (target_ast_type.IsDefined())
+ if (target_ast_type.IsDefined() &&
+ ClangASTContext::IsCXXClassType(target_ast_type.GetOpaqueQualType()))
+ {
m_cplusplus = true;
- if (target_ast_type.IsConst())
- m_const_object = true;
+ if (target_ast_type.IsConst())
+ m_const_object = true;
+ }
}
}
else if (self_var.get())
OpenPOWER on IntegriCloud