fixed issue with mock causing a segmentation fault from pointer deref with lower type (void *) --> (uint8_t *)

This commit is contained in:
jakeg00dwin 2024-07-27 09:22:32 -07:00
parent a92cdead2e
commit 4b44d364e0
1 changed files with 2 additions and 6 deletions

View File

@ -75,12 +75,8 @@ void RegEdit_SetNum(void *reg, uint8_t num)
uint8_t RegEdit_ReadReg(void *reg)
{
uint8_t *reg_ptr = (uint8_t) reg;
uint8_t reg_val = *reg_ptr;
mock_c()->actualCall("RegEdit_ReadReg")
->withPointerParameters("reg", reg)
->returnUnsignedIntValueOrDefault(reg_val);
return reg_val;
->returnUnsignedIntValueOrDefault(0);
//Return value is mock controlled. So it does actually return a uint8_t
}