Skip to content

Commit

Permalink
d3dretrace: Ensure DXVA2_DecodeExecuteParams::pExtensionData is alloc…
Browse files Browse the repository at this point in the history
…ated.

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.
  • Loading branch information
jrfonseca committed May 16, 2016
1 parent d9ff09f commit 2e29588
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions retrace/retrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ def visitPointer(self, pointer, lvalue, rvalue):
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:
Expand Down

0 comments on commit 2e29588

Please sign in to comment.