rose-compiler/rose

Should `RegisterStateGeneric::readRegister` call `RegisterStateGeneric::updateReadProperties`?

markasoftware opened this issue · 2 comments

The RegisterStateGeneric::updateReadProperties method updates the properties on each register, such as IO_READ_BEFORE_WRITE, which are used in some analyses. My understanding is that updateReadProperties should be called whenever the register is read with side effects, but RegisterStateGeneric::readRegister does not call it.

Further, MemoryCellList, which is basically the parallel of RegisterStateGeneric but for non-register memory locations, has a similar readMemory method which does call MemoryCellList::updateReadProperies. This contributes to my feeling that the behavior of RegisterStateGeneric::updateReadProperties is a bug.

I noticed it because I'm trying to do a lightweight calling convention analysis using PartialSymbolicSemantics instead of the full SymbolicSemantics, but while SymbolicSemantics explicitly calls updateReadProperties when appropriate, PartialSymbolicSemantics does not, so registers do not get the appropriate properties set.

(and I believe RegisterStateGeneric should also handle updating write properties when registers are written to).

This bug is fixed on an internal branch and will be tested, merged, and released publicly, probably by the end of the week. Thank you for reporting it.