We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
In this case, what it's doing is placing an item on the stack in a position which will certainly corrupt the stack.Looking through the disassembly for the offending function, I can see that the first line (as expected) is PUSH {r2-r4,r6-r11,lr}But then later in the code, and with NO other stack operations in the meanwhile (nor any function calls or other branches out of the current function context) it hasADD r2,r0,r4,LSL #2LDR r0,|L1.3728|STR r2,[sp,#4]As I understand it, since the stack is full-descending, this means that the value of r2 currently in the stack will get corrupted, because the STR instruction will store the (changed) current r2 value in the position occupied by the original r2. The function in concern is declared void receivePacket(void)so it's not expecting to return values in r2 or take arguments in r2.Why would armcc do something so glaringly illegal? Is there something I can do to fix this?