Ignore:
Timestamp:
07/20/21 16:22:31 (3 years ago)
Author:
jderouillat
Message:

Add bound checking when the workflow view is scaned (highlighted by blitz check in debug mode)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_reorder.cpp

    r2184 r2190  
    110110   int countMasked(0); // countMasked will store the offset index between full and workflow views 
    111111   for (size_t i = 0; i < indexSize ; ++i) { 
    112      if ( sourceFullIdx(i)==sourceWorkflowIdx(i-countMasked) ) { 
    113        domainDestination->mask_1d(i) = 1; 
     112       if ( ( (i-countMasked) >= sourceWorkflowIdx.numElements() ) 
     113         || ( sourceFullIdx(i)!=sourceWorkflowIdx(i-countMasked) ) ) { 
     114       domainDestination->mask_1d(i) = 0; 
     115       countMasked++; 
    114116     } 
    115117     else { 
    116        domainDestination->mask_1d(i) = 0; 
    117        countMasked++; 
     118       domainDestination->mask_1d(i) = 1; 
    118119     } 
    119120   } 
Note: See TracChangeset for help on using the changeset viewer.