Update ARM inline assembly constraints. Inline assembly in uECC_vli_add is underspecified; the output registers are written to before the input registers are fully consumed. Updating the constraints to include earlyclobber `&`. bug: b/278442070 Change-Id: I1f4c28aeca875c7cdcf1d0847d5dbebc7835b081 Reviewed-on: https://pigweed-review.googlesource.com/c/third_party/github/kmackay/micro-ecc/+/139830 Reviewed-by: Ali Zhang <alizhang@google.com>
diff --git a/asm_arm.inc b/asm_arm.inc index e3c8cb1..12e747f 100644 --- a/asm_arm.inc +++ b/asm_arm.inc
@@ -20,19 +20,19 @@ #endif #if (uECC_PLATFORM == uECC_arm_thumb) - #define REG_RW "+l" - #define REG_WRITE "=l" + #define REG_RW "+&l" + #define REG_WRITE "=&l" #else - #define REG_RW "+r" - #define REG_WRITE "=r" + #define REG_RW "+&r" + #define REG_WRITE "=&r" #endif #if (uECC_PLATFORM == uECC_arm_thumb || uECC_PLATFORM == uECC_arm_thumb2) - #define REG_RW_LO "+l" - #define REG_WRITE_LO "=l" + #define REG_RW_LO "+&l" + #define REG_WRITE_LO "=&l" #else - #define REG_RW_LO "+r" - #define REG_WRITE_LO "=r" + #define REG_RW_LO "+&r" + #define REG_WRITE_LO "=&r" #endif #if (uECC_PLATFORM == uECC_arm_thumb2)