The problem is that function can’t get the processor stuck unless you have done something to corrupt memory. It will just decrement the critical level count, and if 0, re-enable the interrupts.
If you go to disassembly mode, what is the exact instruction that is stuck at, and if you try single stepping what does it do?