summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2016-07-06 23:16:24 +0000
committerGreg Clayton <gclayton@apple.com>2016-07-06 23:16:24 +0000
commitdf62e731ea92515d6725a0cf3120454c0d1b4ace (patch)
tree3dd971f93a7de61e18227bfc6f8b8915fa2cdd90
parent5e4bd2e7c403988123155e9f2321a2d8f233a0d6 (diff)
downloadbcm5719-llvm-df62e731ea92515d6725a0cf3120454c0d1b4ace.tar.gz
bcm5719-llvm-df62e731ea92515d6725a0cf3120454c0d1b4ace.zip
"frame variable" and "target variable" shouldn't allow us to get the address of bitfields.
"frame variable" and "target variable" are trying to emulate the expression parser when doing things like: (lldb) frame variable &my_struct.my_bitfield And since the expression parser doesn't allow this, we shouldn't allow "frame variable" or "target variable" to succeed. <rdar://problem/27208607> llvm-svn: 274703
-rw-r--r--lldb/source/Core/ValueObject.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index a74599e00df..3e0a31833ef 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -834,20 +834,20 @@ ValueObject::CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_
ExecutionContext exe_ctx (GetExecutionContextRef());
- child_compiler_type = GetCompilerType().GetChildCompilerTypeAtIndex (&exe_ctx,
- idx,
- transparent_pointers,
- omit_empty_base_classes,
- ignore_array_bounds,
- child_name_str,
- child_byte_size,
- child_byte_offset,
- child_bitfield_bit_size,
- child_bitfield_bit_offset,
- child_is_base_class,
- child_is_deref_of_parent,
- this,
- language_flags);
+ child_compiler_type = GetCompilerType().GetChildCompilerTypeAtIndex(&exe_ctx,
+ idx,
+ transparent_pointers,
+ omit_empty_base_classes,
+ ignore_array_bounds,
+ child_name_str,
+ child_byte_size,
+ child_byte_offset,
+ child_bitfield_bit_size,
+ child_bitfield_bit_offset,
+ child_is_base_class,
+ child_is_deref_of_parent,
+ this,
+ language_flags);
if (child_compiler_type)
{
if (synthetic_index)
@@ -1789,6 +1789,10 @@ ValueObject::DumpPrintableRepresentation(Stream& s,
addr_t
ValueObject::GetAddressOf (bool scalar_is_load_address, AddressType *address_type)
{
+ // Can't take address of a bitfield
+ if (IsBitfield())
+ return LLDB_INVALID_ADDRESS;
+
if (!UpdateValueIfNeeded(false))
return LLDB_INVALID_ADDRESS;
OpenPOWER on IntegriCloud