Simple shift right cause problem in interrupt

Hello together,

the following code makes problem if it is called inside inerrupt.

uint16_t b[].p?

void IntSCL(){
noInterrupts();
uint16_t v = 0xffff;
b[idx].p2 = v;
v = ((v >> 4) & 2);
b[idx].p = v;
idx++
interrupts();
}

in b[idx].p2 is the right value. b[idx].p2 = 0xFFFF

but b[idx].p will be always 0

what ever i try. if i use shift then i have problem.

6 hours of wasting time

Please post complete code or a small example that exhibits the problem.

uint16_t b[].p

What is that supposed to be? If I just add that line to an empty sketch, it already complains

sketch_oct20a:1: error: expected initializer before '.' token
 uint16_t b[].p;
             ^

Please post code using code tags; see How to use this forum - please read, specifically point 7.

Please post complete error messages when encountering problems.

void IntSCL(){
  // noInterrupts();    //////////// Not needed in an ISR
  uint16_t v = 0xffff;
  b[idx].p2 = v;
  v = ((v >> 4) & 2);    // This should always be 2  (0x0FFF & 0x0002)
  b[idx].p = v;
  idx++
  // interrupts();    //////////// Not needed in an ISR
 }