summaryrefslogtreecommitdiff
path: root/retrace
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2016-05-16 14:20:39 +0100
committerJose Fonseca <jfonseca@vmware.com>2016-05-16 14:24:28 +0100
commit2e29588754727a264bcfa4c2c27df59239c97f04 (patch)
treed232c776d5554526a66c0164508634267df5f1cc /retrace
parentd9ff09f309ddab08942841566d7bfe0ae7a34ad7 (diff)
d3dretrace: Ensure DXVA2_DecodeExecuteParams::pExtensionData is allocated.
The ValueAllocator/ValueDeserializer split needs to be rethought, as it is not a good fit: there are several cases where allocations happen besides the root value.
Diffstat (limited to 'retrace')
-rw-r--r--retrace/retrace.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/retrace/retrace.py b/retrace/retrace.py
index e20ba028..b894a821 100644
--- a/retrace/retrace.py
+++ b/retrace/retrace.py
@@ -156,6 +156,11 @@ class ValueDeserializer(stdapi.Visitor, stdapi.ExpanderMixin):
tmp = '_a_' + pointer.tag + '_' + str(self.seq)
self.seq += 1
+ if self.insideStruct:
+ # Member is a pointer to an object, hence must be allocated
+ print r' static_assert( std::is_pointer< std::remove_reference< decltype( %s ) >::type >::value , "lvalue must be a pointer" );' % lvalue
+ print r' %s = _allocator.allocArray<%s>(&%s);' % (lvalue, pointer.type, rvalue)
+
print ' if (%s) {' % (lvalue,)
print ' const trace::Array *%s = (%s).toArray();' % (tmp, rvalue)
try: