fixed issue with mock causing a segmentation fault from pointer deref with lower type (void *) --> (uint8_t *)
This commit is contained in:
parent
a92cdead2e
commit
4b44d364e0
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue