Skip to content

Commit 27144b5

Browse files
committed
msp432p4: Replace alloca with 53 reg array
1 parent 7e35068 commit 27144b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/target/msp432p4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ static bool msp432_flash_write(
268268
DEBUG_WARN("Flash protect: 0x%08" PRIX32 "\n", target_mem32_read32(target, mf->flash_protect_register));
269269

270270
/* Prepare input data */
271-
uint32_t *regs = alloca(target->regs_size / sizeof(uint32_t)); // Use of VLA
271+
uint32_t regs[CORTEXM_GENERAL_REG_COUNT + CORTEX_FLOAT_REG_COUNT];
272272
target_regs_read(target, regs);
273273
regs[0] = SRAM_WRITE_BUFFER; // Address of buffer to be flashed in R0
274274
regs[1] = dest; // Flash address to be write to in R1

0 commit comments

Comments
 (0)