File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -717,13 +717,17 @@ CMiniMdBase::InitColsForTable(
717
717
// should we write the data into the structure
718
718
{
719
719
const CMiniTableDef *pTemplate; // Template table definition.
720
- CMiniColDef pCols[9 ]; // The col defs to init.
720
+ // Mark the array of columns as not allocated (not ALLOCATED_MEMORY_MARKER) for SetNewColumnDefinition
721
+ const uint8_t MAX_COL_COUNT = 9 ;
722
+ BYTE colData[1 + sizeof (CMiniColDef) * MAX_COL_COUNT];
723
+ colData[0 ] = 0 ;
724
+ CMiniColDef* pCols = BYTEARRAY_TO_COLDES (colData);
721
725
BYTE iOffset; // Running size of a record.
722
726
BYTE iSize; // Size of a field.
723
727
HRESULT hr = S_OK;
724
728
725
729
_ASSERTE ((bExtra == 0 ) || (bExtra == 1 ));
726
- _ASSERTE (ARRAY_SIZE (pCols) >= pTable->m_cCols );
730
+ _ASSERTE (MAX_COL_COUNT >= pTable->m_cCols );
727
731
728
732
bExtra = 0 ;// <TODO>@FUTURE: save in schema header. until then use 0.</TODO>
729
733
You can’t perform that action at this time.
0 commit comments